xcode “NSUnknownKeyException”:该类不符合键的键值编码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4839825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:09:22  来源:igfitidea点击:

'NSUnknownKeyException': this class is not key value coding-compliant for the key

xcodensunknownkeyexception

提问by MortadaAK

I got this message:

我收到了这条消息:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FirstViewController 0x601b610> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key newCell.'

How do I solve it?

我该如何解决?

回答by Mytheral

That is generally due to deleting an IB object but forgetting to delete it's links.

这通常是由于删除了 IB 对象但忘记删除它的链接。

IE deleting a UIScrollView but forgetting to delete how it used to link into UIView through an IBOutlet.

IE 删除 UIScrollView 但忘记删除它如何通过 IBOutlet 链接到 UIView。

Had the same problem earlier today... found the answer here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/47036-setvalue-forundefinedkey-class-not-key-value-coding-compliant-key.html

今天早些时候遇到了同样的问题......在这里找到了答案:http: //www.iphonedevsdk.com/forum/iphone-sdk-development/47036-setvalue-forundefinedkey-class-not-key-value-coding-compatible-密钥.html

回答by Johann

In case that helps someone else, after checking and updating all your links between the views and the matching IBOulet, Cleaning you project can sometimes fix this issue.

如果对其他人有帮助,在检查并更新视图与匹配 IBoulet 之间的所有链接后,清理您的项目有时可以解决此问题。