码迷,mamicode.com
首页 > 其他好文 > 详细

Xcode7新特性

时间:2016-02-23 18:56:55      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:

更新Xcode7之后报错:

Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3491.2.5/UIApplication.m:3173

原因:新的SDK不允许在设置rootViewController之前做过于复杂的操作,导致在didFinishLaunchingWithOptions 结束后还没有设置rootViewController。

解决办法: 

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self.window makeKeyAndVisible];

之后直接加入代码

self.window.rootViewController = [[UIViewController alloc] init];

临时设置一个root,在之后重新对root赋值

Xcode7新特性

标签:

原文地址:http://www.cnblogs.com/lile2015/p/5210640.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!