this class is not key value coding-compliant for the key XXX

╰半夏微凉° 2022-03-11 03:40 275阅读 0赞

我是新手,做的第一个应用就出现了下列问题:

(看图片附件1)

错误原因:

在stackoverflow中找到一点思路,虽然看的不是很懂,但是大致了解意思

It is caused by the Second view controller in MainWindow.xib having a class of UIViewControllerinstead of SecondView. Changing to the correct class resolves the problem.

最后通过调试,发现运行根本就没进入到我定义的QuizViewController中,所以就更别谈显示QuizViewController.xib了(answerField在这里面)

错误地方:

(看图片附件2)

如果这里声明了你的第一个nib file的话,那么他首先就想要会显示QuizViewController .xib,但是该xib所对应的QuizViewController为nil,然后准备启动QuizViewController.xib,它肯定就会报错啊!所以在Quiz-info.plist删掉它,现在大功告成了!

发表评论

表情:
评论列表 (有 0 条评论,275人围观)

还没有评论,来说两句吧...

相关阅读