首页 > 技术文章 > 'NSUnknownKeyException' this class is not key value coding-compliant for the key XXX

argenbarbie 2016-09-07 17:20 原文

错误:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key XXX.'

原因:

xib中控件绑定的变量XXX已经不存在或类型不对等。

解决方法:

在xib中找到绑定变量有问题的控件。接触绑定或重新绑定。

推荐阅读