ArtSabintsev ArtSabintsev - 3 months ago 18
iOS Question

Applications are expected to have a root view controller at the end of application launch

I get the following error in my console:


Applications are expected to have a root view controller at the end of application launch


Below is my
application:didFinishLaunchWithOptions
method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Set Background Color/Pattern
self.window.backgroundColor = [UIColor blackColor];
self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
//self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg.png"]];

// Set StatusBar Color
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

// Add the tab bar controller's current view as a subview of the window
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}


In Interface Builder, the
UITabBarController
's delegate is hooked up to the App Delegate.

Anyone know how to fix this issue?

sho sho
Answer

I had this same problem. Check your main.m. The last argument should be set to the name of the class that implements the UIApplicationDelegate protocol.

retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");