title: iOS equivalent of Android finish()
body: <p>I am relatively new to iOS development. I developed an app for Android first, and now am porting it to iOS. One thing that I can't figure out is how to make a <code>ViewController</code> "go away". I'm accustomed to the <code>finish()</code> method in Android. With that method, the current activity ends itself and the user is presented with the the previous screen that was open prior to opening the current screen.</p>
  
  <p>What I'm trying to accomplish is making my "create" screen go away after a record is saved. In the Android world, I would just call the <code>finish()</code> method and that would be taken care of. What is the iOS equivalent?</p>
  
  <p>I have tried the following code in my iOS app, hoping that the view would be animated away.</p>
  
  <pre><code>[self.navigationController popToRootViewControllerAnimated:YES];
  </code></pre>
  
  <p>Edit:
  The view was presented as below.</p>
  
  <pre><code>SettingsViewController *vc = [[SettingsViewController alloc] initWithNibName:@"SettingsView"]; 
  controllers = [NSArray arrayWithObject:vc];
  self.sideMenu.navigationController.viewControllers = controllers;
  [self.sideMenu setMenuState:MFSideMenuStateClosed];
  </code></pre>
  
  <p>where <code>controllers</code> is defined as such:</p>
  
  <pre><code>NSArray *controllers = nil;
  </code></pre>