2016-11-04 104 views
1

对不起,问这个noob问题,我知道它已被问过几千次之前,我知道,因为我有这个问题几千次之前。但是这次谷歌没有帮助。如何调试:libC++ abi.dylib:以NSException类型的未捕获异常终止?

错误/终端打印:

libc++abi.dylib: terminating with uncaught exception of type NSException 

我大致知道什么类型的情况下,造成这一点,因为我曾在过去的这个问题,这是很简单的解决,通常是一个名不副实的功能或一些UI元素和我的代码之间的断开的链接,但现在我不知道是什么可能导致它。

我已经尝试过:

我已经添加起始的ViewController断点吨,它遍历所有@IBOutlets不会引发任何问题。我在AppDelegate的所有方法中都添加了断点,并且在那里的任何地方都不会中断。代码在到达任何viewDidLoad()方法之前崩溃。我已经清理了我的项目,重新启动了XCode一千次,甚至破坏并重新制作了用户界面和代码之间的所有链接。重命名,然后重新分配每个@IBAction。

在这一点上,我什至不知道我没有尝试过。每一个stackoverflow帖子总是大约相同的事情“检查断开的链接等”,但这只是没有帮助了。我不记得我改变了是什么,因为在我开始发现这个错误之前,我改变了很多小东西。我试图把一切都回来,但这似乎没有帮助。

当应用程序崩溃:

紧接着“applicationDidBecomeActve()”完成调试器进入一堆机器代码,然后应用程序崩溃,我得到这个:

enter image description here

证明正确联:

[移除图像,因为他们是不必要]

我的主要问题(S):

如果链接不是这里的问题,还有什么可能呢?

关于NSLogs /堆栈跟踪

我很愿意提供某种的NSLog或堆栈跟踪我看到有人问,并给予其他的问题,但我不知道怎么样。我在互联网上找不到石器时代关于如何开启它们的任何东西。其他的一切都是如何使用调试器,但是我使用的是调试器,而我所得到的只是我的代码的简短瞥见,直到它最终崩溃为止。

编辑:

显然模拟器上进行的,而不是物理设备上运行时,我只能得到日志。这里是模拟器运行时,我得到的日志:

objc[40258]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x123242998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x123067d38). One of the two will be used. Which one is undefined. 
2016-11-04 16:26:47.463 KotConnect[40258:1345011] Unknown class ProgressViewContainer in Interface Builder file. 
2016-11-04 16:26:47.500 KotConnect[40258:1345011] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIView 0x7fbfe3c0a030> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loadingView.' 
*** First throw call stack: 
(
    0 CoreFoundation      0x00000001105ca34b __exceptionPreprocess + 171 
    1 libobjc.A.dylib      0x000000011002b21e objc_exception_throw + 48 
    2 CoreFoundation      0x00000001105ca299 -[NSException raise] + 9 
    3 Foundation       0x000000010fb3b26f -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291 
    4 UIKit        0x0000000110e0580d -[UIView(CALayerDelegate) setValue:forKey:] + 173 
    5 UIKit        0x000000011114f79e -[UIRuntimeOutletConnection connect] + 109 
    6 CoreFoundation      0x000000011056f590 -[NSArray makeObjectsPerformSelector:] + 256 
    7 UIKit        0x000000011114e122 -[UINib instantiateWithOwner:options:] + 1867 
    8 UIKit        0x0000000110ee1c21 -[UIViewController _loadViewFromNibNamed:bundle:] + 386 
    9 UIKit        0x0000000110ee2543 -[UIViewController loadView] + 177 
    10 UIKit        0x0000000110ee2878 -[UIViewController loadViewIfRequired] + 201 
    11 UIKit        0x0000000110f2307b -[UINavigationController _layoutViewController:] + 55 
    12 UIKit        0x0000000110f23963 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 471 
    13 UIKit        0x0000000110f23ada -[UINavigationController _startTransition:fromViewController:toViewController:] + 133 
    14 UIKit        0x0000000110f24ce5 -[UINavigationController _startDeferredTransitionIfNeeded:] + 874 
    15 UIKit        0x0000000110f25dc7 -[UINavigationController __viewWillLayoutSubviews] + 58 
    16 UIKit        0x000000011111cd6f -[UILayoutContainerView layoutSubviews] + 223 
    17 UIKit        0x0000000110e05f50 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237 
    18 QuartzCore       0x0000000110ac3cc4 -[CALayer layoutSublayers] + 146 
    19 QuartzCore       0x0000000110ab7788 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366 
    20 QuartzCore       0x0000000110ab7606 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 
    21 QuartzCore       0x0000000110a45680 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280 
    22 QuartzCore       0x0000000110a72767 _ZN2CA11Transaction6commitEv + 475 
    23 QuartzCore       0x0000000110a730d7 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113 
    24 CoreFoundation      0x000000011056ee17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 
    25 CoreFoundation      0x000000011056ed87 __CFRunLoopDoObservers + 391 
    26 CoreFoundation      0x00000001105534b6 CFRunLoopRunSpecific + 454 
    27 UIKit        0x0000000110d3b7e6 -[UIApplication _run] + 434 
    28 UIKit        0x0000000110d41964 UIApplicationMain + 159 
    29 KotConnect       0x000000010d52cc8f main + 111 
    30 libdyld.dylib      0x00000001135c968d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 
+1

您可以发布您的应用程序日志,当你的应用程序崩溃? –

+0

终于找到如何获取日志后,我设法弄清楚它是什么。显然,我的自定义类没有被分配正确的模块。我发现这里的修复:http://stackoverflow.com/questions/24924966/xcode-6-strange-bug-unknown-class-in-interface-builder-file – Reilem

+1

然后恭喜! –

回答

相关问题