title: Call UIViewController from "subview"
body: <p>I have a UIViewController which when it loads it loads up this..</p>
  
  <pre><code>MapViewController *mapController = [[MapViewController alloc] initWithNibName:@"MapView" bundle:nil];
      self.mapViewController = mapController;
      [self.view insertSubview:mapController.view atIndex:0];
      [mapController release];
  </code></pre>
  
  <p>I also have a switch views button that can change to a table view....</p>
  
  <pre><code>if (self.tableViewController ==nil)
      {
          TableViewController *tableController = [[TableViewController alloc] initWithNibName:@"TableView" bundle:nil];
          self.tableViewController = tableController;
      [tableController release];
      //[self.view insertSubview:detailController atIndex:0];
      }
  
      if (self.mapViewController.view.superview == nil)
      {
          [tableViewController.view removeFromSuperview];
          [self.view insertSubview:mapViewController.view atIndex:0];
      }
      else
      {
          [mapViewController.view removeFromSuperview];
          [self.view insertSubview:tableViewController.view atIndex:0];
      }
  </code></pre>
  
  <p>I am trying to change the view to a detail view based on selecting a row in the table view and I cannot work out how to call it at all.  All methods I have seem to fail!  Please help!</p>