在 iPad 设备(以调试模式编译)上运行的 Objective-C 应用程序中使用NSAssert()
引发NSInternalInconsistencyException
异常的 a 后,我得到类似于:
2012-05-27 02:31:36.830 appname[10821:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'reason'
*** First throw call stack:
(0x3800788f 0x33338259 0x38007789 0x371f13a3 0x791a1 0x79555 0x79e03 0x7a44d 0x798d3 0x737fd 0x30e19c8b 0x30e18461 0x30e0ae87 0x30e7b7d5 0x30e18e6d 0x30e127dd 0x30de0ac3 0x30de0567 0x30ddff3b 0x3644122b 0x37fdb523 0x37fdb4c5 0x37fda313 0x37f5d4a5 0x37f5d36d 0x30e1186b 0x30e0ecd5 0x7343f 0x733e4)
terminate called throwing an exception
我怎样才能找到有用的堆栈跟踪,它至少给我一个简单的列表,列出在抛出异常之前调用的所有函数?
Xcode 也无济于事:
bt
在lldb
节目中:
(lldb) bt
* thread #1: tid = 0x1c03, 0x30c6832c libsystem_kernel.dylib`__pthread_kill + 8, stop reason = signal SIGABRT
frame #0: 0x30c6832c libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x331f920e libsystem_c.dylib`pthread_kill + 54
frame #2: 0x331f229e libsystem_c.dylib`abort + 94
frame #3: 0x37682f6a libc++abi.dylib`abort_message + 46
frame #4: 0x3768034c libc++abi.dylib`_ZL17default_terminatev + 24
frame #5: 0x33338356 libobjc.A.dylib`_objc_terminate + 146
frame #6: 0x376803c4 libc++abi.dylib`_ZL19safe_handler_callerPFvvE + 76
frame #7: 0x37680450 libc++abi.dylib`std::terminate() + 20
frame #8: 0x37681824 libc++abi.dylib`__cxa_rethrow + 88
frame #9: 0x333382a8 libobjc.A.dylib`objc_exception_rethrow + 12
frame #10: 0x37f5d50c CoreFoundation`CFRunLoopRunSpecific + 404
frame #11: 0x37f5d36c CoreFoundation`CFRunLoopRunInMode + 104
frame #12: 0x30e1186a UIKit`-[UIApplication _run] + 550
frame #13: 0x30e0ecd4 UIKit`UIApplicationMain + 1080
frame #14: 0x0007343e appname`main + 86 at main.m:5
这更好,但仍然不是很有用。我仍然不知道是什么导致了异常被抛出。