现在的位置: 首页 > 综合 > 正文

his class is not key value coding-compliant for the key

2018年09月08日 ⁄ 综合 ⁄ 共 883字 ⁄ 字号 评论关闭

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

一般此问题 都是由interface build与代码中IBOutlet的连接所引起的。

可能是在代码中对iboutlet的名称进行了修改,导致interface build中的连接实效。

如果在该viewcontroller连接的xib文件中没发现错误,

那就很可能是mainWindow.xib文件中存在问题,

本人遇到的问题是在mainWindow.xib的tabbarcontroller的某个tab的viewcontroller设置了loadfrom"**.xib",

但忘了将其class设为对应的viewcontroller类了。

仔细检查自己的nib文件,清理、修正不正确的连接关系即可。

LRDemo[55313:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MainViewController 0x8852580> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mainTableView.'

求助:为什么在 两个文件  其中一个是 MainViewController 另一个是 TestViewController 他们里面都是空的,没有内容, 然而 MainViewController 不可以用,一用就出错 提示:

LRDemo[55313:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MainViewController 0x8852580> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mainTableView.'

而 TestViewController 可用呢

郁闷中

抱歉!评论已关闭.