title: Updating DetailViewController from RootController
body: <p>I'm trying to create an iPad application with a similar user interface to Apple's Mail application, i.e:</p>
  
  <ul>
  <li>RootView controller (table view) on the left hand side of the split view for navigation with a multiple view hierarchy. When a table cell is selected a new table view is pushed on the left hand side</li>
  <li>The new view on the left side can update the detail view.</li>
  </ul>
  
  <p>I can accomplish both tasks, but not together.
  I mean I can make a multi-level table view in the RootController.</p>
  
  <p>Or I can make a single-level table view in the RootController which can update the detailViewController.</p>
  
  <p>Can anyone tell me how to make a multi-level table in the RootController which can update a detailViewController?</p>
  
  <p>There is more source code at the link but below is the method in which I presume I have to declare a new detailViewController (which has to be put in the UISplitViewController):</p>
  
  <pre><code>- (void)tableView:(UITableView *)TableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
  NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
  
  //Get the children of the present item.
  NSArray *Children = [dictionary objectForKey:@"Children"];
  
  //
  if([Children count] == 0) {
      /*
      Create and configure a new detail view controller appropriate for the selection.
      */
      NSUInteger row = indexPath.row;
      UIViewController &lt;SubstitutableDetailViewController&gt; *detailViewController = nil;
  
      if (row == 0) {
          FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc]initWithNibName:@"FirstDetailView" bundle:nil];
          detailViewController = newDetailViewController;
      }
  
      if (row == 1) {
          SecondDetailViewController *newDetailViewController = [[SecondDetailViewController alloc]initWithNibName:@"SecondDetailView" bundle:nil];
          detailViewController = newDetailViewController;
      }
  
      // Update the split view controller's view controllers array.
      NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
      splitViewController.viewControllers = viewControllers//nothing happens.....
      [viewControllers release];// 
  }
  
  else {
  
      //Prepare to tableview.
      RootViewController *rvController = [[RootViewController alloc]initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
  
      //Increment the Current View
      rvController.current_level += 1;
  
      //Set the title;
      rvController.current_title = [dictionary objectForKey:@"Title"];
  
      //Push the new table view on the stack
      [self.navigationController pushViewController:rvController animated:YES];
  
      rvController.tableDataSource = Children;
      [rvController.tableView reloadData]; //without this instrucion,items won't be loaded inside the second level of the table 
  
      [rvController release];
      }
  }
  </code></pre>