title: Universal Master-Detail Application with Core Data and tab controller for iphone storyboard gets unrecognized selector sent to instance error
body: <p>I started a Master-Detail Application in X-Code. I chose the options to be universal, core data, and git repo. When the application comes up, I went into the iphone story board, added a tab view controller, moved the nav/table/detail views it starts with to be in the tab controller as the third tab (in reality I want it to be the fourth). I then chose the tab controller to be the initial view the program should start with when in iphone mode. It builds successfully but does not allow the program to finish loading. The error that comes out is recorded below: </p>
  
  <pre><code>2013-05-11 21:35:00.302 FearlessAndThorough[6318:907] -[UITabBarController topViewController]: unrecognized selector sent to instance 0x1c592020
  2013-05-11 21:35:00.306 FearlessAndThorough[6318:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBarController topViewController]: unrecognized selector sent to instance 0x1c592020'
  *** First throw call stack:
  (0x337f33e7 0x3b4ee963 0x337f6f31 0x337f564d 0x3374d208 0xc9e43 0x35662aa1 0x35662625    0x3565a833 0x35602d1f 0x356027ad 0x356021ef 0x3731a5f7 0x3731a227 0x337c83e7 0x337c838b  0x337c720f 0x3373a23d 0x3373a0c9 0x3565946d 0x356562b9 0xc9ab5 0x3b91bb20)
  libc++abi.dylib: terminate called throwing an exception
  (lldb) 
  </code></pre>
  
  <p>I am hoping that someone has done this before and can give me a little insight as to the proper procedure or steps to take when setting up a tab view controller type app that will then convert into a master detail application for ipad. </p>
  
  <p>Here is the current app delegate's didFinishLaunchingWithOptions: </p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {    
      // Override point for customization after application launch.
      if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
          UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
          UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
          splitViewController.delegate = (id)navigationController.topViewController;
  
          UINavigationController *masterNavigationController = splitViewController.viewControllers[0];
          MasterViewController *controller = (MasterViewController *)masterNavigationController.topViewController;
          controller.managedObjectContext = self.managedObjectContext;
      } else {
          UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
          MasterViewController *controller = (MasterViewController *)navigationController.topViewController;
          controller.managedObjectContext = self.managedObjectContext;
  
      }
      return YES;
  }
  </code></pre>