同样一份代码,用ios8的模拟器没问题,ios9会崩溃,报错:Application windows are expected to have a root view controller at the end of application launch
代码块:
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// UIViewController* vc = [[UIViewController alloc] init];
// self.window.rootViewController = vc;
// vc.view.backgroundColor = [UIColor yellowColor];
// [self.window makeKeyAndVisible];
//
// return YES;
代码块:
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// UIViewController* vc = [[UIViewController alloc] init];
// self.window.rootViewController = vc;
// vc.view.backgroundColor = [UIColor yellowColor];
// [self.window makeKeyAndVisible];
//
// return YES;
self.window.rootViewController = [[EventViewController alloc] init];
[self.window makeKeyAndVisible];
return YES;
}
1.在ios8模拟器环境下,运行OK
2.在ios9模拟器环境下,运行注释掉的那部分代码是OK的,运行本人定义的eventViewcontroller,就会崩溃