博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于xcode7编译旧项目崩溃-[UIApplication _runWithMainScene:transitionContext:completion:]
阅读量:4307 次
发布时间:2019-06-06

本文共 1472 字,大约阅读时间需要 4 分钟。

崩溃原因

crash:
Assertion failure in 
-[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-
 (
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', `enter code here`reason: 'Application windows are expected to have a root
view controller at the end of application launch'
*** First throw call stack:
 

 尝试解决方案一:

//  *************代码做调整,加入到下一个loop周期中,再次运行代码,程序正常。******//
 
- (void)applicationDidBecomeActive:(UIApplication *)application {    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.       //crash in ios9    _testWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];    _testWindow.hidden = NO;       //ok    //    dispatch_async(dispatch_get_main_queue(), ^{    //        _testWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];    //        _testWindow.hidden = NO;    //    });      }
Or
 
 尝试解决方案二:
   Xcode7 需要所有的窗口都必须有根控制器
 
XCODE 7 requires that all the Windows must have a rootViewController You can use easy:
 
UIViewController* vc = [[UIViewController alloc]initWithNibName:nil bundle:nil];  self.window.rootViewController = vc;
 
It's working good if you need to use only UIWindow (for easy examples from any Tutorials - before Xcode 7)!

转载于:https://www.cnblogs.com/mysticCoder/p/5072589.html

你可能感兴趣的文章
talib均线大全
查看>>
期货市场技术分析06_长期图表和商品指数
查看>>
期货市场技术分析07_摆动指数和相反意见理论
查看>>
满屏的指标?删了吧,手把手教你裸 K 交易!
查看>>
不吹不黑 | 聊聊为什么要用99%精度的数据回测
查看>>
对于模拟交易所引发的思考
查看>>
高频交易的几种策略
查看>>
量化策略回测TRIXKDJ
查看>>
量化策略回测唐安奇通道
查看>>
CTA策略如何过滤部分震荡行情?
查看>>
量化策略回测DualThrust
查看>>
量化策略回测BoolC
查看>>
量化策略回测DCCV2
查看>>
mongodb查询优化
查看>>
五步git操作搞定Github中fork的项目与原作者同步
查看>>
git 删除远程分支
查看>>
删远端分支报错remote refs do not exist或git: refusing to delete the current branch解决方法
查看>>
python multiprocessing遇到Can’t pickle instancemethod问题
查看>>
APP真机测试及发布
查看>>
通知机制 (Notifications)
查看>>