title: Dismiss Popover When Row Selected?
body: <p>When selecting a row from the master view of UISPlitViewControler when its in popover mode. Isn't it supposed to dismiss automatically? How can I fix it there?</p>
  
  <p>Usually I would do <code>[self.popoverController dismissPopoverAnimated:YES];</code> but <code>popoverController</code> isn't recognized in this case.</p>
  
  <p>I thought that <code>UISplitViewController</code> is supposed to do this automatically?</p>
  
  <p>Here is my UISplitViewDelegate code that is in my detailViewCOntroller:</p>
  
  <pre><code>- (void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController: (UIPopoverController *)pc
  {
      barButtonItem.title = @"Medical Codes";
      NSMutableArray *items = [[self.toolbar items] mutableCopy];
      [items insertObject:barButtonItem atIndex:0];
      [self.toolbar setItems:items animated:YES];
      [items release];
  }
  
  // Called when the view is shown again in the split view, invalidating the button and popover controller.
  - (void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
  {
      NSMutableArray *items = [[self.toolbar items] mutableCopy];
      [items removeObjectAtIndex:0];
      [self.toolbar setItems:items animated:YES];
      [items release];
  }
  </code></pre>
  
  <p>In my app delegate I have:</p>
  
  <pre><code>@property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController;
  @property (nonatomic, retain) IBOutlet DetailViewControlleriPad *rightViewController;
  @property (nonatomic, retain) IBOutlet RootViewController * leftViewController;
  </code></pre>
  
  <p>And these properties are hooked up in IB.  RootViewController pushes to other tableviews, which need to be dismissed when they are selected while in popover mode.</p>
  
  <p>edit</p>
  
  <pre><code>- (void)setDetailItem:(id)newDetailItem
  {
      if (detailItem != newDetailItem)
      {
          [detailItem release];
          detailItem = [newDetailItem retain];
          [self.myTableView reloadData];
      }
  }
  </code></pre>