A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© medicine 中级黑马   /  2015-12-9 18:52  /  869 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

今天按照挂网Swift教程做练习。很奇怪,同样的代码,如果打得慢点,就会运行失败,编译没有问题,就是运行的时候出现这个错误。删除project重新来过,同样的代码,只是打的快一些,就可以了。然后过一会又会出现一次。一下错误中的myLabel的变量我都改了名字了,可是报错还是会出现。我都怀疑会不会像浏览器一样有缓存的概念啊?问题如下,请大虾帮忙:
2015-08-26 21:09:50.877 FoodTracker[3437:819515] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FoodTracker.ViewController 0x7fcbb9414f00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myLabel.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001011d8c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000102d43bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001011d88a9 -[NSException raise] + 9
3 Foundation 0x00000001015f6b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000101120d50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x0000000101d4f4eb -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x0000000101ba76d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x0000000101ba7cc8 -[UIViewController loadView] + 109
8 UIKit 0x0000000101ba7f39 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x0000000101ba83ce -[UIViewController view] + 27
10 UIKit 0x0000000101ac3289 -[UIWindow addRootViewControllerViewIfPossible] + 58
11 UIKit 0x0000000101ac364f -[UIWindow _setHidden:forced:] + 247
12 UIKit 0x0000000101acfde1 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x0000000101a73417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
14 UIKit 0x0000000101a7619e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
15 UIKit 0x0000000101a75095 -[UIApplication workspaceDidEndTransaction:] + 179
16 FrontBoardServices 0x00000001048405e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
17 CoreFoundation 0x000000010110c41c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18 CoreFoundation 0x0000000101102165 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x0000000101101923 __CFRunLoopRun + 851
20 CoreFoundation 0x0000000101101366 CFRunLoopRunSpecific + 470
21 UIKit 0x0000000101a74b02 -[UIApplication _run] + 413
22 UIKit 0x0000000101a778c0 UIApplicationMain + 1282
23 FoodTracker 0x0000000100fdeed7 main + 135
24 libdyld.dylib 0x0000000103479145 start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

1 个回复

倒序浏览
6666666666666666
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马