title: Mail and Message not Dismissing from Alert View
body: <p>I have a UIAlertView that launches an email and a messages screen. When a user clicks on the Alert's button, both views open, however, they do not close.</p>
  
  <p>I have a tried adding:</p>
  
  <pre><code>-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>to the body of the class, however, it did not help.</p>
  
  <p>Here is how the email is presented:</p>
  
  <pre><code>    [viewController presentViewController:email animated:YES completion:nil];
  </code></pre>
  
  <p><strong>Edit Here is the entire code I am using to present the email:</strong></p>
  
  <pre><code>//send email...
  -(void)sendEmail{
  
      //mail composer
      Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
      if(mailClass != nil){
          if([mailClass canSendMail]){
  
              //get the current view controller from the App Delegate
              apptester_appDelegate *appDelegate = (apptester_appDelegate *)[[UIApplication sharedApplication] delegate];
              UIViewController *viewController = [appDelegate getViewController];
  
              MFMailComposeViewController *email = [[MFMailComposeViewController alloc] init];
              email.mailComposeDelegate = self;
  
              //navigation bar color depends on iOS7 or lower...
              if(floor(NSFoundationVersionNumber) &lt;= NSFoundationVersionNumber_iOS_6_1){
                  [[email navigationBar] setTintColor:[UIColor blackColor];
              }else{
                  [[email navigationBar] setBarTintColor:[UIColor blackColor]];
              }
  
              //show the model view...
              [viewController presentViewController:email animated:YES completion:nil];
  
          }
      }
  }
  </code></pre>
  
  <p>Has anyone else experienced this error?</p>
  
  <p>This may not be relevant, but this app has a tab bar.</p>