xcode 7.0运行时main.m报错
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// 实例化
_window.backgroundColor = [UIColor blueColor]; //window 的背景色
[_window makeKeyAndVisible];
//让window成主窗口 并可见
运行结果
2015-12-15 22:22:50.838 UIWindow[6315:671478] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294
2015-12-15 22:22:50.845 UIWindow[6315:671478] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a97af65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a3f4deb objc_exception_throw + 48
2 CoreFoundation 0x000000010a97adca +[NSException raise:format:arguments:] + 106
3 Foundation 0x000000010a042ae2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x000000010ad26275 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2875
5 UIKit 0x000000010ad22ff0 -[UIApplication workspaceDidEndTransaction:] + 188
6 FrontBoardServices 0x000000010d63a7ac -[FBSSerialQueue _performNext] + 192
7 FrontBoardServices 0x000000010d63ab1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
8 CoreFoundation 0x000000010a8a70a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
9 CoreFoundation 0x000000010a89cfcc __CFRunLoopDoSources0 + 556
10 CoreFoundation 0x000000010a89c483 __CFRunLoopRun + 867
11 CoreFoundation 0x000000010a89be98 CFRunLoopRunSpecific + 488
12 UIKit 0x000000010ad2298d -[UIApplication _run] + 402
13 UIKit 0x000000010ad27676 UIApplicationMain + 171
14 UIWindow 0x0000000109ef4e8f main + 111
15 libdyld.dylib 0x000000010d00692d start + 1
16 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException