I am getting "Applications are expected to have a root view controller at the end of application launch" statement in console while application is not opening after displaying splash screen. my application:didFinishLaunchWithOptions method is:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
UIViewController *initViewController = [storyboard instantiateViewControllerWithIdentifier:@"FirstInfo"];
[self.window setRootViewController:initViewController];
[self.window makeKeyAndVisible];
[self.window makeKeyWindow];
return YES;
main.m is as:
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
The application was previously working fine. It is just a quick not functioning from Today. I am using ARC and Storyboard in the application. Please Suggest.
Make sure that the controller being returned from the storyboard is not nil.
Edit While you are at it...where do you create self.window ?
add a "MainStoryboard" into your project, and set Main Storyboard option in build settings as "MainStoryboard"
then, update the AppDelegate method:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}
It works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With