The application did not start on time, even with a background thread

I check network availability in applicationDidFinishLaunching:

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

Background stream

-(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 application does not start on time?

0
source share
1 answer

Is the [self updateInterfaceWithReachability: internetReach];correct user interface update in the main thread? If not, this can be a problem.

Otherwise, I suggest you make sure that your applicationDidFinishLaunching:returns correctly as you expect.

, - , , , . , ( , ).

0

Source: https://habr.com/ru/post/1769981/


All Articles