Iphone 即使有后台线程,应用程序也无法及时启动
我正在ApplicationIDFinishLaunching中检查网络可达性:Iphone 即使有后台线程,应用程序也无法及时启动,iphone,objective-c,cocoa-touch,debugging,reachability,Iphone,Objective C,Cocoa Touch,Debugging,Reachability,我正在ApplicationIDFinishLaunching中检查网络可达性: [self performSelectorInBackground:@selector(performReachabilityCheck) withObject:nil]; 背景线程 -(void)performReachabilityCheck{ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; internetRe
[self performSelectorInBackground:@selector(performReachabilityCheck) withObject:nil];
背景线程
-(void)performReachabilityCheck{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
internetReach = [[Reachability reachabilityForInternetConnection] retain];
[internetReach startNotifer];
[self updateInterfaceWithReachability: internetReach];
[pool release]; pool = nil;
}
我不知道为什么我的应用程序不能及时启动?是
[自我更新与可达性交互:internetReach]代码>是否在主线程中正确更新UI?如果不是,那可能是个问题
否则,我建议您确保您的applicationdFinishLaunching:
正确地按预期快速返回
另一件要尝试的事情是在应用程序启动时,但在它无法启动之前,闯入调试器。检查回溯,确保主事件循环处于可感知状态(听起来好像不是)。另一种方法: