OK, when you create a project with a Storyboard or Nib then the project settings will tell the project that the storyboard/nib is the "Main Interface".
This triggers the application to load that interface on start up. This is why the self.window
is created in these cases.
When you create an empty application there is no interface to set as the main interface.
You then need to create the window yourself like this...
-(void)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *someController = [UIViewController... //create your initial controller
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
}
Something like this anyway. It's been a while.
Alternatively, if you create an empty application and then add a nib file that you want to use as the initial nib then you can select it in the project settings.
In the Target in General. In the section "Deployment Info" select the "Main Interface" from the nibs in your project. This will then load that nib when the application starts.