this class is not key value coding-compliant for the key Button 错误解决方法

今天是我学习iOS的第一天。正在看iOS开发指南的书。

边看边做,出现一个错误。

错误日志以及解决方法如下:

2014-12-18 20:14:57.763 Label_ButtonSample_3.2.1[5770:493343] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7fa666115540> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Te.'

*** First throw call stack:

(

0   CoreFoundation                      0x000000010b7bdf35 __exceptionPreprocess + 165

1   libobjc.A.dylib                     0x000000010b456bb7 objc_exception_throw + 45

2   CoreFoundation                      0x000000010b7bdb79 -[NSException raise] + 9

3   Foundation                          0x000000010aff37b3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259

4   CoreFoundation                      0x000000010b707e80 -[NSArray makeObjectsPerformSelector:] + 224

5   UIKit                               0x000000010be6fc7d -[UINib instantiateWithOwner:options:] + 1506

6   UIKit                               0x000000010bccef98 -[UIViewController _loadViewFromNibNamed:bundle:] + 242

7   UIKit                               0x000000010bccf588 -[UIViewController loadView] + 109

8   UIKit                               0x000000010bccf7f9 -[UIViewController loadViewIfRequired] + 75

9   UIKit                               0x000000010bccfc8e -[UIViewController view] + 27

10  UIKit                               0x000000010bbeeca9 -[UIWindow addRootViewControllerViewIfPossible] + 58

11  UIKit                               0x000000010bbef041 -[UIWindow _setHidden:forced:] + 247

12  UIKit                               0x000000010bbfb72c -[UIWindow makeKeyAndVisible] + 42

13  UIKit                               0x000000010bba6061 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2628

14  UIKit                               0x000000010bba8d2c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350

15  UIKit                               0x000000010bba7bf2 -[UIApplication workspaceDidEndTransaction:] + 179

16  FrontBoardServices                  0x000000010e3792a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16

17  CoreFoundation                      0x000000010b6f353c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12

18  CoreFoundation                      0x000000010b6e9285 __CFRunLoopDoBlocks + 341

19  CoreFoundation                      0x000000010b6e9045 __CFRunLoopRun + 2389

20  CoreFoundation                      0x000000010b6e8486 CFRunLoopRunSpecific + 470

21  UIKit                               0x000000010bba7669 -[UIApplication _run] + 413

22  UIKit                               0x000000010bbaa420 UIApplicationMain + 1282

23  Label_ButtonSample_3.2.1            0x000000010af2abf3 main + 115

24  libdyld.dylib                       0x000000010dd4d145 start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb) 



这个错误是因为我用control按住并且拖拽Button到代码后,我又把代码给删除了,就会出现这个错误。

解决方法是在故事版中的事件绑定里面把刚在在代码上删除的部分在这也删除。

也就是说删除代码的同时也要删除故事版试图的事件绑定关系。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值