Crash ReasonCrashAssertion 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 W Indows is expected to has a rootview controller at the end of application launch‘First throw call stack:)Try solution one:The code makes adjustments, joins the next loop cycle, runs the code again, and the program is normal. ******//- (void) Applicationdidbecomeactive: (UIApplication*) Application {
Restart any tasks this were paused (or not yet started) while the application is inactive. If the application is 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;
// });
}OrTry solution two:Xcode7 need all windows must have a root controller Xcode 7 requires that all the Windows must has a rootviewcontroller you can take easy:Uiviewcontroller* VC = [[Uiviewcontrolleralloc]initwithnibname:nil bundle:nil]; self< Span style= "font:14.0px Menlo; Font-variant-ligatures:no-common-ligatures; " >. window. rootviewcontroller It's working good if you need the only UIWindow (for easy examples from any tutorials-before Xcode 7)!
About upgrading Xcode7 compilation crashes-[uiapplication _runwithmainscene:transitioncontext:completion:] Issues