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 –