title: dismissModalViewController then popViewController
body: <p>I have been searching for a solution to my problem but haven't found anything so far.</p>
  
  <p>I have a UINavigationController with a stack of UIViewControllers (this is all within a TabbarController, if that is relevant). At the last ViewController, I want to send an email:</p>
  
  <pre><code>MFMailComposeViewController *emailVC = [[MFMailComposeViewController alloc] init];
  // fill out emailVC properties ...
  [self presentModalViewController:emailVC animated:YES];
  </code></pre>
  
  <p>Then in the delegate after the email has been sent, I want to close the email viewcontroller and also pop off the last viewcontroller in the NavigationController stack:</p>
  
  <pre><code>-(void)mailComposeController:(MFMailComposeViewController *)controller
        didFinishWithResult:(MFMailComposeResult)result
                      error:(NSError *)error
      {
          // save some variables here ...
          [self dismissModalViewControllerAnimated:YES]; // This line works by itself
          [self.navigationController popViewControllerAnimated:NO]; // this line causes EXC_BAD_ACCESS
  </code></pre>
  
  <p>However, the last line causes a crash somewhere.
  I have checked the ViewController stack before and after. The last viewController correctly gets removed from the list.</p>
  
  <p>Any thoughts or suggestions are welcome. The problem could lie somewhere else in my code I want to make sure I have this part ok. Thank you.</p>