2017-04-13 12:16:36.606 Boardmeeting[4601:1375127] Uncaught exception [<UIViewController 0x7f988fe32750> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnAvatar.
2017-04-13 12:16:36.611 Boardmeeting[4601:1375127] Stack trace: (
0 CoreFoundation 0x000000010f555d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010efbe21e objc_exception_throw + 48
2 CoreFoundation 0x000000010f555c99 -[NSException raise] + 9
3 Foundation 0x000000010d25e9df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x000000010d90d293 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010db8179e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010f4fa9e0 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x000000010db80122 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x000000010d9139c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x000000010d9142e7 -[UIViewController loadView] + 177
10 UIKit 0x000000010d91461c -[UIViewController loadViewIfRequired] + 201
11 UIKit 0x000000010d914e70 -[UIViewController view] + 27
12 UIKit 0x000000010d9734f3 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 483
13 UIKit 0x000000010d972935 -[UITabBarController transitionFromViewController:toViewController:] + 59
14 UIKit 0x000000010d96e7f6 -[UITabBarController _setSelectedViewController:] + 365
15 UIKit 0x000000010d96e57b -[UITabBarController setSelectedIndex:] + 131
16 Boardmeeting 0x0000000109746bce -[LoginViewController prepareForSegue:sender:] + 350
17 UIKit 0x000000010df4817f -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 353
18 UIKit 0x000000010df47fed -[UIStoryboardSegueTemplate _perform:] + 82
19 UIKit 0x000000010d917a1f -[UIViewController performSegueWithIdentifier:sender:] + 99
20 Boardmeeting 0x00000001097470ee -[LoginViewController requestFinished:] + 446
21 Boardmeeting 0x00000001096fbe9e -[ASIHTTPRequest reportFinished] + 142
22 Foundation 0x000000010d27ee9e __NSThreadPerformPerform + 326
23 CoreFoundation 0x000000010f4fa761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
24 CoreFoundation 0x000000010f4df98c __CFRunLoopDoSources0 + 556
25 CoreFoundation 0x000000010f4dee76 __CFRunLoopRun + 918
26 CoreFoundation 0x000000010f4de884 CFRunLoopRunSpecific + 420
27 GraphicsServices 0x0000000115158a6f GSEventRunModal + 161
28 UIKit 0x000000010d772c68 UIApplicationMain + 159
29 Boardmeeting 0x0000000109758eae main + 142
30 libdyld.dylib 0x000000011067b68d start + 1
)
回答
这通常发生在从类中删除IBOutlet,但不会删除Outlet链接故事板。
在你的情况下,它是btnAvatar:你可以从你的课程/控制器中删除这个,但你把它留在故事板上吗?
不,它已经存在,它显示连接检查器中的正确链接! –
正如你可以从堆栈跟踪中看到的那样,它是一个“运行时间插座连接”,所以它绝对是一个插座问题,并且提到btnAvatar以便...更好地检查。如果需要,删除并重新执行 –
@RezoanulAlamRiad“UIViewController”实际上是您使用的类名称?你没有忘记为你的UIViewController设置真正的类吗? (您可能已经设置了它,链接了IBOutlet,但之后删除了该类)。 – Larme
- 1. iOS6崩溃:此类不是密钥编码兼容密钥
- 2. 斯威夫特的setValue:forUndefinedKey:]:此类不是密钥值编码兼容的关键
- 3. setValue:forUndefinedKey:]:此类不是关键字adDescription的编码兼容密钥值。'
- 4. NSUnknownKeyException这个类不是密钥编码兼容的密钥
- 5. 错误:此类不是关键值编码兼容的密钥密钥路径
- 6. NSManageObjectContext - 类不是密钥编码兼容密钥@count
- 7. 'NSUnknownKeyException'setValue:forUndefinedKey:该类不是密钥值编码兼容密钥XXX'。
- 8. 这个类不是密钥编码兼容密钥setOutput
- 9. MPMediaItem这个类不是密钥编码兼容密钥
- 10. 运行时错误:此类不是密钥编码兼容密钥
- 11. “[<UIProxyObject>的setValue:forUndefinedKey:]:这个类不是密钥值用于密钥containerView兼容编码-
- 12. 实体xxx不是密钥值编码兼容密钥“(空)”
- 13. 实体Shop不是密钥值编码兼容密钥“category.name”
- 14. 该类不是密钥值编码兼容的密钥XXX - 类正确确认?
- 15. EntityDescription的值ForUndefinedKey这个类不是密钥编码兼容的密钥“KEY”
- 16. 映射与Restkit 0.20这个类不是密钥编码兼容密钥
- 17. 这个类不是密钥编码兼容的关键pdfView
- 18. 这个类不是密钥编码兼容的关键视图
- 19. 这个类不是关键值编码兼容的密钥mapview
- 20. 这个类不是密钥编码兼容的关键findContact
- 21. 这个类不是密钥编码兼容的关键PerformRotate
- 22. 此课程不是密钥编码密钥UILabel
- 23. 此类不是密钥表编码兼容的关键值SWIFT 3
- 24. 错误:该实体不是密钥编码兼容密钥 - 核心数据
- 25. SIGABRT-这个类不是关键值编码兼容密钥
- 26. RestKit - 非密钥值编码兼容
- 27. “这个类别不是密钥的关键值编码 - ”异常
- 28. 获取“这个类不是密钥编码兼容的密钥ID”。当请求RestKit loadObjectsAtResourcePath
- 29. Java:从编码密钥获取密钥
- 30. [valueForUndefinedKey:]:此类不是密钥约定编码密钥约定日期。' - 迅速
提供一些代码或检查何时出现此问题,通过添加brekpoints –