7
IIRC,這通常工作。但最近我注意到,NSAssert…()
不給我堆棧跟蹤,或至少沒有有用的:從NSAssert沒有堆棧跟蹤
2012-02-26 14:41:19.283 MyApp[3299:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '…'
*** First throw call stack:
(0x33cc58bf 0x353e11e5 0x33cc57b9 0x317583b3 0x78423 0x76e35 0x77dbf 0x217dd 0x12c63 0x3178a943 0x33c99a63 0x33c996c9 0x33c9829f 0x33c1b4dd 0x33c1b3a5 0x3585bfcd 0x34d60743 0xde87 0x30dc)
terminate called throwing an exception(gdb) bt
#0 0x3629232c in __pthread_kill()
#1 0x34b3ef5a in pthread_kill()
#2 0x34b37fea in abort()
#3 0x35fe9f6a in abort_message()
#4 0x35fe734c in default_terminate()
#5 0x353e12e2 in _objc_terminate()
#6 0x35fe73c4 in safe_handler_caller()
#7 0x35fe7450 in std::terminate()
#8 0x35fe8824 in __cxa_rethrow()
#9 0x353e1234 in objc_exception_rethrow()
#10 0x33c1b544 in CFRunLoopRunSpecific()
#11 0x33c1b3a4 in CFRunLoopRunInMode()
#12 0x3585bfcc in GSEventRunModal()
#13 0x34d60742 in UIApplicationMain()
#14 0x0000de86 in main (argc=1, argv=0x2fdffaa4) at …/main.mm:18
(gdb)
我讀的地方,使用iOS部署目標是Xcode中沒有對這一原因的符號,最近我的設置從4.0更改爲4.3。然而,改回它沒有區別。
OTOH,assert(…)
按預期工作。
當NSAssert…()
失敗時,爲什麼Xcode不提供適當的可導航堆棧跟蹤?