Xcode 4.2 iOS Empty Application and storyboards Xcode 4.2 iOS Empty Application and storyboards ios ios

Xcode 4.2 iOS Empty Application and storyboards


Comment out (or remove) the window creation and display code in AppDelegate.m as follows:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{    // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];    // Override point for customization after application launch.    // self.window.backgroundColor = [UIColor whiteColor];    // [self.window makeKeyAndVisible];    return YES;}

When using a storyboard, a main UIWindow is created for you automatically. What is happening in your case is that you are creating another white window and putting it over the top of the tab UI.

ALSO - note that the Master/Detail template also gives you a core data option.


For an Empty Application project, you have to do two things, after you've added your Storyboard file...

  1. Add a row to your project Info.plist file:

    Key: Main storyboard file base nameValue: Storyboard

    (or whatever you named your storyboard file)

  2. Delete the contents of application:didFinishLaunchingWithOptions: except return YES;:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{    return YES;}


The Master-Detail and Utility project templates also offer Core Data as an option.

The Apple templates for Core Data are pretty horrible. They stuff far too much functionality into the app delegate and they use lazy loading unnecessarily, which just complicates things even further.

You're better off looking at the generated code and adding the functionality as a separate class in a project you start without Core Data.

To answer your immediate question though, the default empty template creates a window programmatically in the app delegate's application:didFinishLaunchingWithOptions: method. The story board sets a window up itself, so you need to remove that code from the app delegate. The only thing you need in that method is return YES;.