App shows white screen sometimes - iOS4
My app runs well on iOS4, except that sometimes it shows a whitescreen, especially after a long period of time not using the app (I guess that it may get deleted from the background, but I already tried), but then, if I close the app and reopen it again, everything works just fine. I don't know if there is any specific problem with this. It is a normal iphone app with tabs.
Here is the application:didFinishLaunchingWithOptions:
,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
gpsUpdate=0;
NSLog(@"entro a didFinishLaunch");
if (locationManager == nil ) {
}
if ([launchOptions objectForKey: UIApplicationLaunchOptionsLocationKey] != nil) {
// register for local notification
}
else {
iconBadNumber=0;
[self checkConnection];
[self copyDatabaseIfNeeded];
iconBadNumber=0;
self.alertsArray = [[NSMutableArray alloc] init];
self.searchArray = [[NSMutableArray alloc] init];
[Alertas getAllAlerts];
[window addSubview:tabBarController.view];
}
[tabBarController set开发者_StackOverflowDelegate:self];
return YES;
}
you are adding subview as tabBarController.view for window in only one condition. Always inside the didFinishLaunchingWithOptions method you need to add some view as a subview to window otherwise it will show white screen as it is the default color of the window.
精彩评论