Search code examples
iosios9xcode7-beta4

Update project to iOS9 with XCode7 beta 4


I just tried to run my project with the new XCode7 beta4 but is giving me this exception immediately after running the simulator:

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

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'

I read that maybe can be a problem with setting rootViewVontroller of the main window but my code in the AppDelegate.m file is this one:

[self.tabBarController setViewControllers:tabViewControllers];

[self.tabBarController setCustomizableViewControllers:customizableControllers];

[self.window setRootViewController:self.tabBarController];

where the tabBarController class is a custom UITabViewController. I DONT use any .xib file in my project! Anybody have an idea how i can proceed?

Thanks in advance


Solution

  • Issue occurred in Xcode 7.0.Solution is Replace this code in your main.m file.

    int main(int argc, char * argv[]) {
        @autoreleasepool {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
        }
    }