gpt4 book ai didi

ios - 如何在发生崩溃时识别 iOS 应用程序的状态

转载 作者:搜寻专家 更新时间:2023-10-30 20:24:15 24 4
gpt4 key购买 nike

具有以下崩溃日志堆栈。我可以说发生崩溃时应用程序处于前台状态吗?因为我可以看到 UIKit 调用。应该如何识别 App 的各种状态。像 Suspended/Background/Foreground

**

#0
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000f158936c

**

Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3a72c626 objc_msgSend + 5
1 CoreFoundation 0x2feae16b +[__NSArrayI __new:::] + 58
2 CoreFoundation 0x2feab945 -[__NSPlaceholderArray initWithObjects:count:] + 172
3 CoreFoundation 0x2feb5341 +[NSArray arrayWithObjects:count:] + 44
4 CoreFoundation 0x2feeb1bb -[NSDictionary allKeys] + 174
5 UIKit 0x3292430f -[UITouchesEvent _cloneEvent] + 342
6 UIKit 0x32786df9 _UIGestureRecognizerUpdate + 5240
7 CoreFoundation 0x2ff3d255 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
8 CoreFoundation 0x2ff3abf9 __CFRunLoopDoObservers + 284
9 CoreFoundation 0x2ff3af3b __CFRunLoopRun + 730
10 CoreFoundation 0x2fea5ebf CFRunLoopRunSpecific + 522
11 CoreFoundation 0x2fea5ca3 CFRunLoopRunInMode + 106
12 GraphicsServices 0x34dab663 GSEventRunModal + 138
13 UIKit 0x327f214d UIApplicationMain + 1136
14 MyApp 0xff6bf main (main.m:16)
15 libdyld.dylib 0x3ac2fab7 start + 2

最佳答案

com.apple.main-thread 是加载 ViewController UI 的主线程。由于崩溃发生在主线程上,因此应用程序将在前台运行。我希望它有所帮助。

关于ios - 如何在发生崩溃时识别 iOS 应用程序的状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40652339/

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