title: Unable to dismiss MFMailComposeViewController, delegate not called
body: <p>I am calling <code>MFMailComposeViewController</code> from a <code>UITableViewController</code>.
  Problem is the delegate method is never called when I select <em>Cancel</em> or <em>Send</em> button in Mail compose window: </p>
  
  <pre><code>mailComposeController:(MFMailComposeViewController*)controllerdidFinishWithResult 
  </code></pre>
  
  <p>Here is the table view class:</p>
  
  <pre><code>@implementation DetailsTableViewController
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
      if (indexPath.section==0 &amp;&amp; indexPath.row==4) {
          //SEND MAIL
          MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
          controller.mailComposeDelegate = self;
          if ([MFMailComposeViewController canSendMail]) {
              [controller setSubject:[NSString stringWithFormat:@"Ref %@",[item objectForKey:@"reference"]]];
              [controller setMessageBody:@" " isHTML:NO]; 
              [controller setToRecipients:[NSArray arrayWithObject:[item objectForKey:@"email"]]]; 
              [self presentModalViewController:controller animated:YES];
          }
          [controller release];       
      }
  }
  
  - (void)mailComposeController:(MFMailComposeViewController*)controllerdidFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
      // NEVER REACHES THIS PLACE
      [self dismissModalViewControllerAnimated:YES];
      NSLog (@"mail finished");
  }
  </code></pre>
  
  <p>The application doesn't crash. After the Cancel or Send button is pressed, the Compose Window stays on the screen with buttons disabled. I can exit application pressing Home key.</p>
  
  <p>I am able to open other Modal Views form TableView but not MailCompose.</p>