任何人都可以帮助我,我的应用程序在iOS9中崩溃,2周前还不错。 Objective-C的新手,需要帮助。
在xCode中运行应用程序时,我收到此消息
由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'应用程序窗口应在应用程序启动结束时具有根视图控制器'
答案 0 :(得分:0)
您的应用没有根视图控制器。在故事板中选择View Controller作为您的入口点。然后在Attributes Inspector中选中Is Initial View Controller
。
或强>
application didFinishLaunchingWithOptions
方法中的
UIViewController *vC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"viewControllerID"];
self.window.rootViewController = vC;
[self.window makeKeyAndVisible];
return YES;
如果您不使用故事板,只需使用init方法实例化视图控制器。