title: MFMailComposeViewController won't dismiss on iOS 6
body: <p>In iOS 6 the presented <code>MFMailComposeViewController</code> will not dismiss if user attempts to send second email...</p>
  
  <p>Everything works perfectly the first go around and email is sent. However, if email option is selected again the <code>MFMailComposeViewController</code> will not dismiss on cancel. </p>
  
  <p>Here is how I implemented it:</p>
  
  <pre><code>- (IBAction)buttonEmailClick:(id)sender {
      if (![MFMailComposeViewController canSendMail]) {
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can't send" message:@"This device is unable to send emails." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
          [alert show];
          return;
      }
      NSDictionary *contactsInfo = [self contactsInfoFromPlistNamed:kConfigPlistName];
      [mailComposeViewController setToRecipients:[NSArray arrayWithObject:[contactsInfo objectForKey:@"email"]]];
      //[mailComposeViewController setSubject:kEmailDefaultSubject];
      //[mailComposeViewController setMessageBody:text isHTML:NO];
      [self presentModalViewController:mailComposeViewController animated:YES];
  }
  </code></pre>
  
  <p>and then this:</p>
  
  <pre><code>- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
      UIAlertView *alert = nil;
      if (result == MFMailComposeResultSent) {
          alert = [[UIAlertView alloc] initWithTitle:@"Sent" message:@"Your email was sent." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
      }
      else if (result == MFMailComposeResultFailed) {
          alert = [[UIAlertView alloc] initWithTitle:@"Failed" message:@"An error occured and your email was not sent." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
      }
  
      [alert show];
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>It works fine in iOS 5 but not in iOS 6. I have tried replacing with non deprecated methods for iOS 6, but it doesn't work.</p>