Click here to Skip to main content
15,891,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
below is my code

C#
NSString *questionString = [[ NSString alloc] initWithFormat:@"%lu",[questions count]];
    int questions = [questionString intValue];
    NSString *answerString = [[NSString alloc] initWithFormat:@"%lu" , [answers count]];
    int answers = [answerString intValue]/3;
    NSString *correctAnswersString = [[NSString alloc] initWithFormat:@"%lu" , [correctAnswers count]];
    int correctAnswers = [correctAnswersString intValue];
    if ((questions = answers) && (questions == correctAnswers)) {
        NSLog(@"Questions, answers and correct answers written");
    }
    else
    {
        NSLog(@"\nWARNING APP WILL CRASH \nSOLUTION: \nCheck if you have the same amount of questions and CORRECT answers, AND if you jave 3 answers for each question!");
        NSLog(@"\nQUESTIONS = %d \nANSWERS = %d (3 tiems more) \nCORRECTANSWERS = %d ", questions , [answerString intValue] , correctAnswers);
    }



}
Posted

1 solution

you missed a "=" in this line
if ((questions == answers) && (questions == correctAnswers))


The error says that you QS1 in KVO but I dont see any. It is a method or class name which you didnt show?
My tip is that, you used KVO-syntax but dont implement it.

You should read the Documenation from Apple to understand the complex KVO.
 
Share this answer
 
Comments
Member 11342373 9-Jan-15 1:07am    
thanks for the answer :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900