本文介绍了这是什么意思呢? class不是密钥QS1的密钥值编码兼容。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是我的代码
NSString * questionString = [[NSString alloc] initWithFormat: @ %lu,[问题数]];
int questions = [questionString intValue];
NSString * answerString = [[NSString alloc] initWithFormat: @ %lu,[答案数]];
int answers = [answerString intValue] / 3;
NSString * correctAnswersString = [[NSString alloc] initWithFormat: @ %lu,[ correctAnswers count]];
int correctAnswers = [correctAnswersString intValue];
if ((questions = answers)&&(questions == correctAnswers)){
NSLog( @ 问题,答案和正确答案);
}
else
{
NSLog( @ \ n警告APP将崩溃\ nSOLUTION:\ n如果您有相同数量的问题和正确答案,请检查,如果您为每个问题提供3个答案!);
NSLog( @ \ nNESESTIONS =%d \ nANSWERS =%d(3连多) \\ n \\ nCORRECTANSWERS =%d,questions,[answerString intValue],correctAnswers);
}
}
解决方案
below is my code
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); } }
解决方案
这篇关于这是什么意思呢? class不是密钥QS1的密钥值编码兼容。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!