iPhone - 对于我已删除的属性,该类不符合编码?
我从视图控制器类中删除了一个名为 ScrollView 的属性。 但是,现在每当我尝试将此视图控制器推送到导航控制器上时,都会收到一条错误消息:
[ setValue:forUndefineKey:]: this class is not key valuecoding-driven for the key rollView
I've did and Edit>Find for ScrollView 到处都找不到它。
有什么想法可能导致这种情况吗?
I removed a property called ScrollView from my viewcontroller class.
However, now whenever I try to push this viewcontroller onto the nav controller, I get an error saying:
[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key scrollView
I've done and Edit>Find for ScrollView and can't find it anywhere.
Any ideas what might be causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查你的笔尖。听起来您将其声明为 IBOutlet 并在 Interface Builder 中将某些内容连接到它。您已删除该属性,因此当笔尖反序列化时,它无法再连接插座。
Check your nib. It sounds like you declared it as an
IBOutlet
and connected something to it in Interface Builder. You've removed the property, so when the nib is deserialised, it can't connect the outlet any more.这要么是吉姆上面建议的,要么您正在使用 initWithNibName:bundle: 加载 viewController,并且您正在加载不正确的 Nib 文件...
如果您从代码的另一个点进行了复制粘贴,那么您很可能忘记更新笔尖文件。
我经常这样做并最终出现你提到的错误:P
It's either what Jim suggested above, or you are loading a viewController with the initWithNibName:bundle: and you are loading an incorrect Nib file...
If you did a copy paste from another point of your code, then it's likely you forgot to update the Nib file.
I often do this and end up with the error you mentioned :P