title: How to hide the rootView controller only in landscape mode in a SplitView
body: <p>Right now I have code that allows me to hide the side bar which represents the rootView Controller.  When I go into landscape mode the "root list" button is replaced by a "hide sidebar" button and when clicked it removes the RootViewController from the splitView. Here is the code found in the AppDelegate:</p>
  
  <pre><code>//Thanks to Alice McGregor for the code!!!
  - (IBAction)toggleSplitView:(id)sender {
      if ( [window.subviews containsObject:splitViewController.view] ) {
  
          [splitViewController.view removeFromSuperview];
  
          splitViewController.viewControllers = [NSArray arrayWithObjects:rootViewController, rootViewController, nil];
  
          [window addSubview:detailViewController.view];
  
          [(UIBarButtonItem *)sender setTitle:@"Show Sidebar"];
  
      } else {
  
          [detailViewController.view removeFromSuperview];
          [detailViewController.view setTransform:CGAffineTransformIdentity];
  
          splitViewController.viewControllers = [NSArray arrayWithObjects:rootViewController,     detailViewController, nil];
  
          [window addSubview:splitViewController.view];
          [detailViewController.view sizeToFit];
  
          [(UIBarButtonItem *)sender setTitle:@"Hide Sidebar"];
      }
  }
  </code></pre>
  
  <p>This removes the rootView (table) when the hide sidebar button is selected.  However, when you flip to portrait mode, the root list button isn't there and is instead replaced by the "show sidebar" button.</p>
  
  <p>I need to make this so that when in landscape mode, the table is hidden, however you can still select the root list button in portrait mode.  Any ideas?</p>