gpt4 book ai didi

iphone - 应用特定信息 : Application failed to launch in time (iOS)?

转载 作者:可可西里 更新时间:2023-11-01 05:06:45 25 4
gpt4 key购买 nike

这是我的一份崩溃报告的顶部。 Apple 是否有任何 App Launch 超时限制?如果是这样,有什么常见的解决方法吗?

Elapsed total CPU time (seconds): 13.700 (user 8.580, system 5.120), 67% CPU 
Elapsed application CPU time (seconds): 6.180, 30% CPU

在 iPhone 3G 上。

我可能不得不拆分/延迟我的启动任务......

最佳答案

我认为它必须在 5(或可能 10)秒内启动,否则 iPhone 会认为它已经崩溃。

尽量避免在启动时在主线程上加载大量内容。如果您需要加载很多东西,请在后台线程上执行,如下所示:

- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like

[self performSelectorInBackground:@selector(loadInBackground)];
}

- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements

[self performSelectorOnMainThread:@selector(finishedLoading) withObject:nil waituntilDone:NO];
}

- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
window.rootViewController = viewController;
[window makeKeyAndVisible];
}

关于iphone - 应用特定信息 : Application failed to launch in time (iOS)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9241008/

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