title: multiple master and detail views in iPad split view, uisplitview
body: <p>Thanks ahead of time.  I am currently developing the iPad version of an app which on the iphone has 3 tabs,which each load 3 different rss feeds and then drill down to details with a navigation controller on the iPhone.  On the iPad what makes sense is that I join 2 of the feeds in the first splitview, and then have a separate master and detail for the 3rd feed.</p>
  
  <p>what is the best practice to accomplish this.  I currently have setup a toolbar button in the first detailview, which calls the appdelegate which switches the master and detail as so</p>
  
  <pre><code>- (void)switchViews {
  
      VideoSelectorViewController *masterViewController = nil;
      VideoDetailiPadViewController *detailViewController = nil;
      UIViewController *tempDetail = [self.splitViewController.viewControllers objectAtIndex:1];
      UIViewController *tempMaster = [self.splitViewController.viewControllers objectAtIndex:0];
      [tempDetail.view removeFromSuperview];
      [tempMaster.view removeFromSuperview];
      [tempDetail release];
      [tempMaster release];
      tempDetail = nil;
      tempMaster = nil;
  
    //  if (row == 1) {
          VideoSelectorViewController *newMasterViewController = [[VideoSelectorViewController alloc] initWithNibName:@"VideoSelectorViewController" bundle:nil];
          masterViewController = newMasterViewController;
  
          VideoDetailiPadViewController *newDetailViewController = [[VideoDetailiPadViewController alloc] initWithNibName:@"VideoDetailiPadViewController" bundle:nil];
          detailViewController = newDetailViewController;
  
    //  }
  
      // Update the split view controller's view controllers array.
      NSArray *viewControllers = [[NSArray alloc] initWithObjects:masterViewController, detailViewController, nil];
      self.splitViewController.viewControllers = viewControllers;
      [viewControllers release];
  
  /*  // Dismiss the popover if it's present.
      if (popoverController != nil) {
          [popoverController dismissPopoverAnimated:YES];
      }*/
  
      // Configure the new view controller's popover button (after the view has been displayed and its toolbar/navigation bar has been created).
     // if (detailViewController.popover != nil) {
          [detailViewController showRootPopoverButtonItem:detailViewController.rootPopoverButtonItem];
      //}
  
      [masterViewController release];
      [detailViewController release];
  
  
  }
  </code></pre>
  
  <p>this works ok when the iPad is in landscape but on portrait the barbutton does not show up in the toolbar, how can i call - (void)splitViewController: (UISplitViewController*)svc willHideViewController programmatically?  Also memory management for my method, should i release and set to nil the previous master and detail as I am with those temp objects in my switchViews method?</p>
  
  <p>The other method is to push the new master on to the old, and just replace the detail.  which is better, memory wise, performance, etc.  thanks again</p>