title: MFMailComposeViewController Blank Screen When Opening in Landscape Mode
body: <p>Using MFMailComposeViewController works fine when the phone is in UIInterfaceOrientationPortrait, however If I do not allow autorotation I get something like this when the user rotates the phone:</p>
  
  <p><img src="https://i.stack.imgur.com/SlG2r.png" alt="enter image description here"></p>
  
  <p>So I decided to allow the view controller (which is also a modal view), that is a part of the view that calls the modal view to rotate:</p>
  
  <p>RootAppInfoViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  
  @interface RootAppInfoViewController : UIViewController &lt;UINavigationControllerDelegate&gt;{
      UINavigationController *navigationControl;
  }
  
  @property (nonatomic,retain) IBOutlet UINavigationController *navigationControl;
  
  //dismisses this modal view
  - (IBAction)selectHome:(id)sender;
  
  @end
  </code></pre>
  
  <p>RootAppInfoViewController.m</p>
  
  <pre><code>// Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      // Return YES for supported orientations.
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  }
  </code></pre>
  
  <p>(Having this autorotate allows rotation for this entire view by the way). But this is a mere view controller and I want a table view to be presented modally so I have this class, which is referenced through the RootAppInfoViewController.xib which makes this modal view a table view:</p>
  
  <p>AppInfoViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;MessageUI/MessageUI.h&gt;
  
  
  @interface AppInfoViewController : UITableViewController &lt;MFMailComposeViewControllerDelegate, UINavigationControllerDelegate&gt; {
      NSMutableArray *dataSourceArray;
  }
  
  @property(nonatomic, retain) NSMutableArray *dataSourceArray;
  
  @end
  </code></pre>
  
  <p>AppInfoViewController.m</p>
  
  <pre><code>//..
  /* //NOTE: Commenting or uncommenting this block of code has no effect!
  // Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      // Return YES for supported orientations.
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  }//*/
  //...
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
      [tableView deselectRowAtIndexPath:indexPath animated:YES];
      NSString *source = [[[self.dataSourceArray objectAtIndex:indexPath.section] objectForKey:kSourceKey] objectAtIndex:indexPath.row];
  
      if(indexPath.section == kFeedbackSection) {
          if([MFMailComposeViewController canSendMail]) {
              // fill out email
              //...
              MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
              //MailCompose *controller = [[MailCompose alloc] init];
              controller.mailComposeDelegate = self;
              [[controller navigationBar] setTintColor:[UIColor oceanColor]];
              [controller setToRecipients:[NSArray arrayWithObject:kFeedbackEmail]];
              [controller setSubject:emailSubject];
              [controller setMessageBody:emailBodyTemplate isHTML:NO];
              [self presentModalViewController:controller animated:YES];
              [controller release];
          } else {
              [UIAlertHelper mailErrorAlert];
          }
      } //... 
  
  }
  
  #pragma mark -
  #pragma mark MFMailComposeViewControllerDelegate methods
  
  - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>Commenting or non-commenting out the autorotation code in this class has no effect. holding the device upright and clicking on the row that loads the MFMailComposeViewControlleryeilds no problems, it loads upright, then it rotates just fine. However, loading the table view, holding it sideways and then tapping on the row with the MFMailComposeViewController loads the modal view controller as a blank screen:</p>
  
  <p><img src="https://i.stack.imgur.com/rdQT3.png" alt="enter image description here"></p>
  
  <p>This happens both in the simulator and the actual physical device.</p>
  
  <p>Anyone know what's up? Thanks in advance!</p>