美文网首页
*** Assertion failure in -[UIApp

*** Assertion failure in -[UIApp

作者: iOS_林亦辰 | 来源:发表于2019-10-29 15:18 被阅读0次

错误原因在于 AppDelegate 中 didFinishLaunchingWithOptions 结束前 未定义 rootViewController,Xcode7规定必须要有rootViewController。
定义一个空UIViewController即可,添加如下代码解决:
UIViewController *emptyView = [[ UIViewController alloc ]initNibName:nil bundle:nil ];
self. window .rootViewController = emptyView;

确保 AppDelegate 中 didFinishLaunchingWithOptions window定义 rootViewController

相关文章

网友评论

      本文标题:*** Assertion failure in -[UIApp

      本文链接:https://www.haomeiwen.com/subject/ydxgvctx.html