【发布时间】:2015-10-15 05:30:56
【问题描述】:
我刚刚尝试使用新的 XCode7 beta4 运行我的项目,但在运行模拟器后立即给了我这个异常:
Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:],/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3491.2.5/UIApplication.m:3173
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
我读到设置主窗口的 rootViewVontroller 可能会出现问题,但我在 AppDelegate.m 文件中的代码是这个:
[self.tabBarController setViewControllers:tabViewControllers];
[self.tabBarController setCustomizableViewControllers:customizableControllers];
[self.window setRootViewController:self.tabBarController];
tabBarController 类是一个自定义的 UITabViewController。 我不在我的项目中使用任何 .xib 文件!有人知道我该如何继续吗?
提前致谢
【问题讨论】:
-
您是否先运行转换并消除所有警告?它在 Xcode 6.x 上运行良好,对吧?
-
“转化”是什么意思?我做了“更新到 raccomended 设置”,但我没有摆脱警告.. 但真的是愚蠢的警告,比如 (- (NSUInteger)supportedInterfaceOrientations 要更新到 - (UIInterfaceOrientationMask)supportedInterfaceOrientations)。你有什么想法可以成为@rholmes 吗?
-
检查答案的更新。特别是,您是否尝试过 (1) 在 Xcode 7 (2) 中使用源代码控制差异来定位以前的 iOS (8.x) 以查看是否有任何无意更改。
标签: ios ios9 xcode7-beta4