She*_*lam 10 iphone debugging xcode objective-c ios4
我该如何诊断此错误?
Application Specific Information:
MyApp failed to launch in time
Elapsed total CPU time (seconds): 4913.443 (user 3868.270, system 1045.173), 56% CPU
Elapsed application CPU time (seconds): 0.010, 0% CPU
Backtrace not available
Unknown thread crashed with unknown flavor: 5, state_count: 1
Binary Images:
0x2fe00000 - 0x2fe26fff dyld armv7 <a11905c8ef7906bf4b8910fc551f9dbb> /usr/lib/dyld
Run Code Online (Sandbox Code Playgroud)
这是我的didFinishLaunching方法:
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))
{
NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
}
// Override point for customization after application launch.
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil];
//Check for connectivity
internetReach = [[Reachability reachabilityForInternetConnection] retain];
[internetReach startNotifer];
[self updateInterfaceWithReachability: internetReach];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
return YES;
}
Run Code Online (Sandbox Code Playgroud)
Phi*_*ert 28
您可能在AppDelegate的应用程序中进行了大量的设置工作:didFinishLaunching方法.
您应该确保此功能尽快退出.任何需要时间的设置工作(例如网络访问)都应该在应用程序中异步完成.在这种情况下,您可以显示一个微调器来向用户指示应用程序正在加载.
为了向Philippe Leybaert的回复添加这样的信息.
如果应用程序需要花费很多时间来启动主线程将被杀死,因此应用程序将崩溃.
在提交之前测试此issu的方法是部署到testflight或使用adhoc并将其安装在您要支持的较慢设备上.
| 归档时间: |
|
| 查看次数: |
10063 次 |
| 最近记录: |