跳转到内容

学科:IOS/KB/Uncaught exception

来自维基学院

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

[编辑 | 编辑源代码]

示例:

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

可能原因:

  • IBOutlet没有正确设置,没连,或者连的位置不对
  • MyClass的实现部分没synthesize MyTitle变量