title: how to use back button with presentViewController?
body: <p>Here is my code for calling a new view controller that is wrapped in a UINavigationController. I want a simple back button on the restaurantResults controller. My selector does not seem to work. I've tried using pop commands. Will those work since I am using presentViewController and not any sort of push?</p>
  
  <p>Pretty sure my selector is wrong right now because it says self.navigationController, which can't possibly be right.</p>
  
  <p>Here is where I call the new view controllers and set up the back button:</p>
  
  <pre><code> - (void)searchBarSearchButtonClicked:(UISearchBar *)foodNearSearchBar
  {
  
   restaurantsViewController *restaurantResults = [[restaurantsViewController alloc] init];
      UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:restaurantResults];
  
  
      UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back"
                                                                     style:UIBarButtonItemStyleBordered
                                                                    target:nil
                                                                    action:@selector(backPressed:)];
  
      restaurantResults.navigationItem.leftBarButtonItem = backButton;
  
  
      [self presentViewController:navController animated:YES completion:Nil];
  
  }
  </code></pre>
  
  <p>Here is my selector:</p>
  
  <pre><code>   -(void)backPressed: (id)sender
  {
      [self.navigationController popViewControllerAnimated: YES]; // or popToRoot... if required.
  }
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code> - (void)backPressed:(id)sender
      {
          [self dismissViewControllerAnimated:YES completion:nil];
      };
  </code></pre>