After launch I have a crash:
2015-11-13 17:47:50.744 app[18380:611105] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
I've read other questions with ios9 and root view controller and now my appdelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
MainViewController *main = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
NSArray *windows = [[UIApplication sharedApplication] windows];
for(UIWindow *window in windows) {
NSLog(@"window: %@",window.description);
if(window.rootViewController == nil){
UIViewController *vc = [[UIViewController alloc]initWithNibName:nil bundle:nil];
window.rootViewController = vc;
}
}
self.window.rootViewController = main;
[self.window setRootViewController:main];
[self.window makeKeyAndVisible];
return YES;
}
Unfortunately the problem is still there.