当我点击任何按钮时,我的应用程序崩溃了。它会抛出一个lldb run time error
。我打印了回溯:
* thread #1: tid = 0x2aaf3, 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 2.1
frame #0: 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000181666bd4 CoreFoundation`-[NSException raise] + 12
frame #2: 0x0000000182124720 Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:] + 256
frame #3: 0x00000001815b25ec CoreFoundation`-[NSArray makeObjectsPerformSelector:] + 248
frame #4: 0x00000001849eadd0 UIKit`-[UINib instantiateWithOwner:options:] + 1232
frame #5: 0x000000018492f878 UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 280
frame #6: 0x0000000184630488 UIKit`-[UIViewController loadViewIfRequired] + 88
frame #7: 0x00000001846303f4 UIKit`-[UIViewController view] + 32
frame #8: 0x00000001847dd868 UIKit`-[UINavigationController _startCustomTransition:] + 704
frame #9: 0x00000001846e7f54 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 464
frame #10: 0x00000001846e7d24 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 56
frame #11: 0x00000001846e7ca4 UIKit`-[UILayoutContainerView layoutSubviews] + 200
frame #12: 0x000000018462aff8 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 348
frame #13: 0x000000018421c258 QuartzCore`-[CALayer layoutSublayers] + 184
frame #14: 0x0000000184216e20 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 300
frame #15: 0x0000000184216cd8 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
frame #16: 0x0000000184216560 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 280
frame #17: 0x0000000184216304 QuartzCore`CA::Transaction::commit() + 424
frame #18: 0x000000018420fc38 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
frame #19: 0x00000001816276a8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
frame #20: 0x0000000181624930 CoreFoundation`__CFRunLoopDoObservers + 372
frame #21: 0x0000000181624cbc CoreFoundation`__CFRunLoopRun + 764
frame #22: 0x0000000181565c20 CoreFoundation`CFRunLoopRunSpecific + 452
frame #23: 0x000000018724dc0c GraphicsServices`GSEventRunModal + 168
frame #24: 0x0000000184696fdc UIKit`UIApplicationMain + 1156
* frame #25: 0x00000001001297a4 myapp`main(argc=1, argv=0x000000016fd33ca8) + 116 at main.m:16
frame #26: 0x000000018e163aa0 libdyld.dylib`start + 4
这是什么意思?
答案 0 :(得分:2)
这是你的问题:
Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:]
因为在此之后,会引发Exception
:
CoreFoundation`-[NSException raise] + 12
您正在尝试在对象中设置>>的值不存在或存在其他问题。
P.S。:用一些相关代码更新您的答案,以便我可以用更多解释更新我的答案。