title: Multi-level navigation controller on left-hand side of UISplitView with a small twist
body: <p>I'm trying to make something <em>similar</em> to (but not exactly like) the <strong>email app</strong> found on the <strong>iPad</strong>.</p>
  
  <p>Specifically, I'd like to create a <strong><em>tab-based app</em></strong>, but each tab would present the user with <strong>a different UISplitView</strong>.</p>
  
  <p>Each UISplitView contains a Master and a Detail view (obviously).</p>
  
  <p>In each UISplitView, I would like the <strong>Master to be a multi-level navigational controller</strong> where new UIViewControllers are pushed onto (or popped off of) the stack.  This type of navigation within the UISplitView is where the application is similar to the native email app.</p>
  
  <p>To the best of my knowledge, the only place that has described a decent "splitviewcontroller inside of a uitabbarcontroller" is here: <a href="https://stackoverflow.com/questions/2475139/uisplitviewcontroller-in-a-tabbar-uitabbarcontroller">UISplitViewController in a TabBar ( UITabBarController )?</a>  and I've tried to follow the accepted answer.</p>
  
  <p>The accepted solution seems to work for me (i.e., I get a tab-bar controller that allows me to switch between different UISplitViews).</p>
  
  <p><strong><em>The problem is that I don't know how to make the left-hand side of the UISplitView to be a multi-level navigation controller.</em></strong></p>
  
  <p>Here is the code I used within my app delegate to create the initial "split view 'inside' of a tab bar controller" (it's pretty much as suggested in the aforementioned link).</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
      NSMutableArray *tabArray = [NSMutableArray array];
  
      NSMutableArray *array = [NSMutableArray array];
      UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
      MainViewController *viewCont = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
      [array addObject:viewCont];
      [viewCont release];
      viewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
      [array addObject:viewCont];
      [viewCont release];
      [splitViewController setViewControllers:array];
      [tabArray addObject:splitViewController];
      [splitViewController release];
  
  
  
      array = [NSMutableArray array];
      splitViewController = [[UISplitViewController alloc] init];
      viewCont = [[Master2 alloc] initWithNibName:@"Master2" bundle:nil];
      [array addObject:viewCont];
      [viewCont release];
      viewCont = [[Slave2 alloc] initWithNibName:@"Slave2" bundle:nil];
      [array addObject:viewCont];
      [viewCont release];
      [splitViewController setViewControllers:array];
      [tabArray addObject:splitViewController];
      [splitViewController release];
  
          // Add the tab bar controller's current view as a subview of the window
      [tabBarController setViewControllers:tabArray];
  
      [window addSubview:tabBarController.view];
      [window makeKeyAndVisible];
  
      return YES;
  }
  </code></pre>
  
  <p>the class <strong>MainViewController</strong> is a UIViewController that contains the following method:</p>
  
  <pre><code>- (IBAction)push_me:(id)sender {
      M2 *m2 = [[[M2 alloc] initWithNibName:@"M2" bundle:nil] autorelease];
      [self.navigationController pushViewController:m2 animated:YES];
  }
  </code></pre>
  
  <p>this method is attached (via interface builder) to a UIButton found within MainViewController.xib
  Obviously, the method above (push_me) is supposed to create a second UIViewController (called m2) and push m2 into view on the left side of the split-view when the UIButton is pressed.
  And yet it does nothing when the button is pressed (even though I can tell that the method is called).</p>
  
  <p>Thoughts on where I'm going wrong?</p>
  
  <p>TIA!</p>