gpt4 book ai didi

iphone - iOS 应用未能及时启动 0x000000008badf00d - applicationDidBecomeActive 延迟

转载 作者:可可西里 更新时间:2023-11-01 03:54:47 26 4
gpt4 key购买 nike

我将整个 didFinishLaunchingWithOptions 放在此处,代码最少:

 [UIApplication sharedApplication].idleTimerDisabled = YES;
m_bDataLoadingNeeded = YES;
return YES;

因此,我不得不将关键的初始化放在 applicationDidBecomeActive 中。然而,我得到了上述错误。

我得到的所有关于它的引用资料都提到要尽快完成 didFinishLaunchingWithOptions,我已经完成了。 applicationDidBecomeActive 是否需要任何检查?

我的崩溃日志在这里(不知何故,我不能用所有的 dsym 和应用程序来符号化它,所以我不知道哪个语句是确切的罪魁祸首。但每个人都可以看到它绝对不是 didFinishLaunchingWithOptions )

Exception Type:  00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0

Application Specific Information:
<MyBundleID> failed to launch in time

Elapsed total CPU time (seconds): 1.600 (user 1.600, system 0.000), 4% CPU
Elapsed application CPU time (seconds): 0.438, 1% CPU

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3c66f0fc 0x3c65e000 + 69884
1 libsystem_c.dylib 0x3c5b8124 0x3c5b7000 + 4388
2 SystemConfiguration 0x360d43ca 0x360c0000 + 82890
3 MyApp 0x001cd406 0xf9000 + 869382
4 MyApp 0x001ccb78 0xf9000 + 867192
5 MyApp 0x001cd148 0xf9000 + 868680
6 MyApp 0x001d77e4 0xf9000 + 911332
7 MyApp 0x001d7ed0 0xf9000 + 913104
8 MyApp 0x001cd908 0xf9000 + 870664
9 MyApp 0x001d46e0 0xf9000 + 898784
10 MyApp 0x000fb870 0xf9000 + 10352
11 UIKit 0x36177af6 0x36102000 + 482038
12 UIKit 0x3615d9bc 0x36102000 + 375228
13 UIKit 0x36105c34 0x36102000 + 15412
14 UIKit 0x361056c8 0x36102000 + 14024
15 UIKit 0x36105116 0x36102000 + 12566
16 GraphicsServices 0x37dfb5a0 0x37df5000 + 26016
17 GraphicsServices 0x37dfb1ce 0x37df5000 + 25038
18 CoreFoundation 0x342d2170 0x3423b000 + 618864
19 CoreFoundation 0x342d2112 0x3423b000 + 618770
20 CoreFoundation 0x342d0f94 0x3423b000 + 614292
21 CoreFoundation 0x34243eb8 0x3423b000 + 36536
22 CoreFoundation 0x34243d44 0x3423b000 + 36164
23 UIKit 0x3615c480 0x36102000 + 369792
24 UIKit 0x361592fc 0x36102000 + 357116
25 MyApp 0x000fb4be 0xf9000 + 9406
26 MyApp 0x000fb474 0xf9000 + 9332

考虑到 applicationDidBecomeActive 确实是罪魁祸首:

我可以将我的 applicationDidBecomeActive 初始化移动到后台线程中 - 这非常简单 like this ,但我不确定我还需要做什么其他事情,因为这个初始化代码会反过来在内部产生更多线程。我正在使用 AFNetworking、Reachability 和其他基于 block 的框架。我不知道我是否会最终对已经构建的架构和通用代码进行如此多的修改。

我很困惑如何以最好和最短的方式解决这个问题。

最佳答案

我怀疑您的程序在可用之前在主线程上发出了一堆网络请求——阻止用户进行交互几秒钟。

回溯并不(总是/必然)重要——您的应用在特定时间后被杀死。

您可能只需在 Instruments 中运行它,看看您在哪里做的事情可能会花费很长时间; I/O、网络请求——将它们移出主线程,并异步执行它们。还要评估 CPU 热点。初始启动时间应该远没有那么长。

关于iphone - iOS 应用未能及时启动 0x000000008badf00d - applicationDidBecomeActive 延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18493929/

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