I know there are a lot of these out there, but none of the solutions have worked for me.
Here is the situation:
AppDelegate.h
#import <UIKit/UIKit.h>
#import "SphereViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) SphereViewController *sphereViewController;
@end
AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.sphereViewController = [[SphereViewController alloc] initWithNibName:@"SphereViewController" bundle:nil];
NSLog(@"%@", self.sphereViewController);
self.window.rootViewController = self.sphereViewController;
[self.window makeKeyAndVisible];
return YES;
}
...
@end
When running this code the following is logged:
2014-01-04 21:21:18.691 Sphere[4978:70b] <SphereViewController: 0x10931c600>
2014-01-04 21:25:25.145 Sphere[4978:70b] Application windows are expected to have a root view controller at the end of application launch
Why am I getting the root view controller error even though I am setting it?