title: iOS iPhone 5 Choose Correct Storyboard
body: <p>I am attempting to use both storyboards for my iOS project, but I cannot get the code to switch to the appropriate storyboards.  Instead, the code does absolutely nothing.  Is it that I do not have a setting set correctly that controls the switch?  The main storyboard for devices not of the iPhone 5, is called MainStoryboard.  The iphone 5 appropriate layout is called iphone5.  I'm thinking this may be a project configuration setting issue.  (This is in my appdelegate.m file).</p>
  
  <pre><code>-(void)initializeStoryBoardBasedOnScreenSize {
  
      if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
      {    // The iOS device = iPhone or iPod Touch
  
  
          CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
  
          if (iOSDeviceScreenSize.height == 480)
          {   // iPhone 3GS, 4, and 4S and iPod Touch 3rd and 4th generation: 3.5 inch screen (diagonally measured)
  
              // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone35
              UIStoryboard *iPhone35Storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
  
              // Instantiate the initial view controller object from the storyboard
              UIViewController *initialViewController = [iPhone35Storyboard instantiateInitialViewController];
  
              // Instantiate a UIWindow object and initialize it with the screen size of the iOS device
              self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
              // Set the initial view controller to be the root view controller of the window object
              self.window.rootViewController  = initialViewController;
  
              // Set the window object to be the key window and show it
              [self.window makeKeyAndVisible];
          }
  
          if (iOSDeviceScreenSize.height == 568)
          {   // iPhone 5 and iPod Touch 5th generation: 4 inch screen (diagonally measured)
  
              // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone4
              UIStoryboard *iPhone4Storyboard = [UIStoryboard storyboardWithName:@"iphone5" bundle:nil];
  
              // Instantiate the initial view controller object from the storyboard
              UIViewController *initialViewController = [iPhone4Storyboard instantiateInitialViewController];
  
              // Instantiate a UIWindow object and initialize it with the screen size of the iOS device
              self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
              // Set the initial view controller to be the root view controller of the window object
              self.window.rootViewController  = initialViewController;
  
              // Set the window object to be the key window and show it
              [self.window makeKeyAndVisible];
          }
  
      } else if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
  
      {   // The iOS device = iPad
  
          UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
          UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
          splitViewController.delegate = (id)navigationController.topViewController;
  
      }
  }
  </code></pre>