title: I Opened an iPad app second view, now need to return to the first view
body: <p>I am working on an iPad app with two views.  The first view is defined in MainWindow.xib.  The sccond view is defined in View2.xib.  A button in MainWindow.xib initiates the code below and activates View2.  It works great.  Now I need to return to the MainWindow.xib view.  I tried the same code (but in reverse) and it did not work.  I got a SIGABT error in main.  I would appreciate some suggestions as to how to efficiently return from View2 to MainWindow.</p>
  
  <p>Following is the code mentioned above.</p>
  
  <pre><code>if(!View2Controller)
  {
  View2Controller = [[UIViewController alloc] initWithNibName:@"View2" bundle:nill];
  }
  [self presentModalViewController:View2Controller animated:YES];
  
  if(view2Controller.view.superview)
  {
  [view2Controller.view removeFromSuperView];
  }
  }
  </code></pre>