Xcode7新特性

更新Xcode7以後報錯:

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

緣由:新的SDK不容許在設置rootViewController以前作過於複雜的操做,致使在didFinishLaunchingWithOptions 結束後尚未設置rootViewController。ui

解決辦法: spa

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

以後直接加入代碼it

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

臨時設置一個root,在以後從新對root賦值class

相關文章
相關標籤/搜索