您的位置:首页 > 产品设计 > UI/UE

iOS: setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.

2016-02-24 10:04 639 查看
这里指抛出一个假设:

如果你在 storyboard中, 通过 Ctrl - Drag 方式声明了一个 @property , 但你又觉得 在 Ctrl - Drag 时 ,命名的property 不理想, 这时, 你直接在 .h 和 .m 文件中 修改了这个 实例变量的名字, 这时候,编译。 结果该会怎样呢?

不妨试试吧。

这时候,会出现以下错误, 而且还会 crash。

'NSUnknownKeyException', reason: '[<NSObject 0x8c84da0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: