开发者

Application Failed to Launch in Time, even with a background thread

开发者 https://www.devze.com 2023-01-20 20:09 出处:网络
I am checking network reachability in applicationDidFinishLaunching: [self performSelectorInBackground:@selector(performReachabilityCheck) withObject:nil];

I am checking network reachability in applicationDidFinishLaunching:

[self performSelectorInBackground:@selector(performReachabilityCheck) withObject:nil];

Background thread

-(void)performReachabilityCheck{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        internetReach = [[Reachability reachabilityForInternetConne开发者_开发百科ction] retain];
        [internetReach startNotifer];
        [self updateInterfaceWithReachability: internetReach];
    [pool release]; pool = nil;
}

I'm not sure why my app fails to launch in time?


Is [self updateInterfaceWithReachability: internetReach]; correctly updating the UI in the main thread? If not, that could be a problem.

Otherwise, I would suggest you make sure that your applicationDidFinishLaunching: is correctly returning quickly as you expect.

Another thing to try is to break into the debugger as the app is firing up but before it has failed to launch. Check the backtrace and make sure the main event loop is in a sensible state (as it sounds like it isn't).

0

精彩评论

暂无评论...
验证码 换一张
取 消