修改属性名后,应该删除IBOutlet的链接!!

来源:互联网 发布:sql架构 编辑:程序博客网 时间:2024/06/06 03:08

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


提示以上的错误。

原因是:原来的.h中定义的是

@property(nonatomic, strong) IBOutlet UITextField *textField1;

后来修改成

@property(nonatomic, strong) IBOutlet UITextField *textField2;


但界面上的链接还存在。所以运行时出现以上的错误!


原创粉丝点击