我的应用程序因NSUnknownKeyException
而崩溃。我不知道为什么会发生这种崩溃
我的崩溃报告
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<TransactionsViewController 0x8a6bbe0> setValue:forUndefinedKey:]: this class is not
key value coding-compliant for the key sidebarButton.'
*** First throw call stack:
(
0 CoreFoundation 0x017615e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014e48b6 objc_exception_throw + 44
2 CoreFoundation 0x017f16a1 -[NSException raise] + 17
3 Foundation 0x011a59ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x01111cfb _NSSetUsingKeyValueSetter + 88
5 Foundation 0x01111253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x0117370a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x004f4a15 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x014f67d2 -[NSObject performSelector:] + 62
9 CoreFoundation 0x0175cb6a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x004f356e -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x00786a2f -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
12 UIKit 0x00787028 -[UIStoryboardSegueTemplate _perform:] + 88
13 UIKit 0x007870f9 -[UIStoryboardSegueTemplate perform:] + 115
14 libobjc.A.dylib 0x014f6874 -[NSObject performSelector:withObject:withObject:] + 77
15 UIKit 0x002540c2 -[UIApplication sendAction:to:from:forEvent:] + 108
16 UIKit 0x0025404e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
17 UIKit 0x0034c0c1 -[UIControl sendAction:to:forEvent:] + 66
18 UIKit 0x0034c484 -[UIControl _sendActionsForEvents:withEvent:] + 577
19 UIKit 0x0034b733 -[UIControl touchesEnded:withEvent:] + 641
20 UIKit 0x0029151d -[UIWindow _sendTouchesForEvent:] + 852
21 UIKit 0x00292184 -[UIWindow sendEvent:] + 1232
22 UIKit 0x00265e86 -[UIApplication sendEvent:] + 242
23 UIKit 0x0025018f _UIApplicationHandleEventQueue + 11421
24 CoreFoundation 0x016ea83f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25 CoreFoundation 0x016ea1cb __CFRunLoopDoSources0 + 235
26 CoreFoundation 0x0170729e __CFRunLoopRun + 910
27 CoreFoundation 0x01706ac3 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x017068db CFRunLoopRunInMode + 123
29 GraphicsServices 0x037069e2 GSEventRunModal + 192
30 GraphicsServices 0x03706809 GSEventRun + 104
31 UIKit 0x00252d3b UIApplicationMain + 1225
32 FortabBar 0x000049ad main + 141
33 libdyld.dylib 0x01d9f70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
任何人都可以帮我解决这个问题
答案 0 :(得分:1)
您已将Interface Builder中的某些内容(可能是UIButton)连接到名为sidebarButton
的TransactionsViewController,但是TransactionsViewController没有具有该名称的出口。您需要在TransactionsViewController类上声明插座:
@property (nonatomic, weak) IBOutlet UIButton *sidebarButton;
或者您需要在Interface Builder中删除该连接。