title: SplitViewController crashing in Portrait view (ipad)
body: <p>I have a tabbed application that contains five splitviewcontrollers. </p>
  
  <p>In portrait mode, the 'master' button appears as expected, and on the first two controllers that button behaves as expected. On the last three tabs however, the button causes a crash with the following message:</p>
  
  <p>Assertion failure in -[_UISlidingPopoverLayoutInfo _popoverViewSizeForContentSize:arrowDirection:], /SourceCache/UIKit_Sim/UIKit-1914.84/_UIPopoverLayoutInfo.m:160
  2012-04-24 19:15:38.674 SMToolkit[12420:11303] <em>*</em> Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unknown direction passed to _popoverViewSizeForContentSize:arrowDirection:'</p>
  
  <p>Thing is, the five views are cut-n-pasted from the same source, pretty much Apple's boilerplate. I'm not actually storyboarding the popovers, nor do I have them in a prepareforsegue method, since the spliltviewcontroller theoretically gives them to me 'for free'</p>
  
  <p>All five splitviewcontrollers conform to UISplitViewControllerDelegate</p>
  
  <p>The appdelgate is like so:</p>
  
  <pre><code>    UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
     //Person
      UISplitViewController *personSplitViewController = [tabBarController.viewControllers objectAtIndex:1];
      UINavigationController *personNavigationController = [personSplitViewController.viewControllers lastObject];
      personSplitViewController.delegate = (id)personNavigationController.topViewController;
      UINavigationController *personMasterNavigationController = [personSplitViewController.viewControllers objectAtIndex:0];
      PersonMasterViewController *personController = (PersonMasterViewController *)personMasterNavigationController.topViewController;
      personController.managedObjectContext = self.managedObjectContext;
      //Scene
      UISplitViewController *sceneSplitViewController = [tabBarController.viewControllers objectAtIndex:2];
      UINavigationController *sceneNavigationController = [sceneSplitViewController.viewControllers lastObject];
      sceneSplitViewController.delegate = (id)sceneNavigationController.topViewController;
      UINavigationController *sceneMasterNavigationController = [sceneSplitViewController.viewControllers objectAtIndex:0];
      SceneMasterViewController *sceneController = (SceneMasterViewController *)sceneMasterNavigationController.topViewController;
      sceneController.managedObjectContext = self.managedObjectContext;
  </code></pre>
  
  <p>And so on, substituting the correct index in the tabBarController</p>
  
  <p>Then in the detail view controllers, each has the following (identical, I checked):</p>
  
  <pre><code>- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
  {
  barButtonItem.title = NSLocalizedString(@"Master", @"Master");
  [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
  self.masterPopoverController = popoverController;
  }
  
  
  - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
  {
  // Called when the view is shown again in the split view, invalidating the button and popover controller.
  [self.navigationItem setLeftBarButtonItem:nil animated:YES];
  self.masterPopoverController = nil;
  }
  </code></pre>
  
  <p>In the above, 'person' behaves as expected, but 'scene' causes the crash. </p>
  
  <p>I don't see anywhere in any of the views anything that talks about what happens when that barbuttonitem is clicked, and it doesn't appear in the storyboard.</p>
  
  <p>Ideas?</p>