gpt4 book ai didi

ios - 如何获取导致崩溃的类和方法名称?

转载 作者:行者123 更新时间:2023-12-01 19:57:58 24 4
gpt4 key购买 nike

当应用崩溃时,我在调试控制台中处于堆栈下方。

(
0 CoreFoundation 0x000000010811434b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000107b4821e objc_exception_throw + 48
2 CoreFoundation 0x000000010816cbdf -[__NSSingleObjectArrayI objectAtIndex:] + 111
3 FanPaas 0x0000000106fa48fa -[ViewController openCrash] + 90
4 UIKit 0x0000000109bd3b88 -[UIApplication sendAction:to:from:forEvent:] + 83
5 UIKit 0x0000000109d592b2 -[UIControl sendAction:to:forEvent:] + 67
6 UIKit 0x0000000109d595cb -[UIControl _sendActionsForEvents:withEvent:] + 444
7 UIKit 0x0000000109d584c7 -[UIControl touchesEnded:withEvent:] + 668
8 UIKit 0x0000000109c410d5 -[UIWindow _sendTouchesForEvent:] + 2747
9 UIKit 0x0000000109c427c3 -[UIWindow sendEvent:] + 4011
10 UIKit 0x0000000109befa33 -[UIApplication sendEvent:] + 371
11 UIKit 0x000000010a3e1b6d __dispatchPreprocessedEventFromEventQueue + 3248
12 UIKit 0x000000010a3da817 __handleEventQueue + 4879
13 CoreFoundation 0x00000001080b9311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010809e59c __CFRunLoopDoSources0 + 556
15 CoreFoundation 0x000000010809da86 __CFRunLoopRun + 918
16 CoreFoundation 0x000000010809d494 CFRunLoopRunSpecific + 420
17 GraphicsServices 0x000000010f82ba6f GSEventRunModal + 161
18 UIKit 0x0000000109bd1f34 UIApplicationMain + 159
19 FanPaas 0x0000000106fdf66f main + 111
20 libdyld.dylib 0x000000010c65868d start + 1
)

所以我尝试使用 [NSThread callStackSymbols]中的 NSSetUncaughtExceptionHandler(&HandleException)捕获堆栈跟踪。
(
0 FanPaas 0x000000010176f05e +[UncaughtExceptionHandler backtrace] + 46
1 FanPaas 0x000000010176fe92 HandleException + 98
2 CoreFoundation 0x00000001028f156c __handleUncaughtException + 732
3 libobjc.A.dylib 0x00000001022bc496 _ZL15_objc_terminatev + 94
4 libc++abi.dylib 0x0000000107382e69 _ZSt11__terminatePFvvE + 8
5 libc++abi.dylib 0x0000000107382af4 __cxa_rethrow + 99
6 libobjc.A.dylib 0x00000001022bc3b7 objc_exception_rethrow + 40
7 CoreFoundation 0x000000010281151b CFRunLoopRunSpecific + 555
8 GraphicsServices 0x000000010a6bfa6f GSEventRunModal + 161
9 UIKit 0x0000000104345f34 UIApplicationMain + 159
10 FanPaas 0x000000010175020f main + 111
11 libdyld.dylib 0x00000001074ec68d start + 1
)

实际上 [ViewController openCrash]导致崩溃,但我没有在 callStackSymbols中得到它。但这显示在调试控制台中。

如何获取导致崩溃的类和方法名称?

最佳答案

enter image description here

选择顶部的断点符号,然后单击底部的+符号,然后单击异常断点,这样会导致您进入导致崩溃的特定行。

关于ios - 如何获取导致崩溃的类和方法名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41459452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com