iphone – Application Failed to Launch in Time, even with a background thread – Education Career Blog

I am checking network reachability in applicationDidFinishLaunching:

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

Background thread

-(void)performReachabilityCheck{
    NSAutoreleasePool * pool = NSAutoreleasePool alloc init;
        internetReach = Reachability reachabilityForInternetConnection 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).

Leave a Comment