(MFMailComposeViewControllerを使用して)電子メールを送信した後にFacebook共有を表示しようとすると、次のエラーが発生します。
ビューは、一度に最大1つのビューコントローラにのみ関連付けることができます。ビュー[EAGLView]は[EmailViewController]に関連付けられています。このビューを[FacebookView]に関連付ける前に、この関連付けをクリアしてください。
[EmailViewController removeFromParentViewController]; 何もしません
EmailViewController.view = nil; メールフォームが長い間消えていても、白い画面が表示されます。
私がこれまでに送信して電子メールで送信したことを忘れさせ、ビュー階層を以前の状態に戻すにはどうすればよいですか?メールを送信していない場合、Facebookの共有は機能します。
-(IBAction)ShowEmailForm:(char*)pSubject :(char*)pBody :(char*)pTo
{
    Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
    if (mailClass != nil)
    {
        if ([mailClass canSendMail])
        {
            self.view = eaglView;
            MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
            picker.mailComposeDelegate = self;
            [picker setSubject:[NSString stringWithFormat:@"%s", pSubject]];
            // Set up recipients
            if( pTo != nil )
            {
                NSArray *toRecipients = [NSArray arrayWithObject:[NSString stringWithFormat:@"%s", pTo]];
                [picker setToRecipients:toRecipients];
            }
            // Fill out the email body text
            [picker setMessageBody:[NSString stringWithFormat:@"%s",pBody] isHTML:YES];
            [self presentViewController:picker animated:YES completion:^(){}];
            [picker release];
        }
    }
}
// Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the message field with the result of the operation.
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{    
    [self dismissViewControllerAnimated:YES completion:^(){ printf("Email form done dismissing.\n"); }];
    printf("Email form dismissed.\n");
    [self removeFromParentViewController];
    //Email was sent.
    if (result == MFMailComposeResultSent)
    {
        printf("Email Sent!\n");
        NSString *pEmail = [self findEmailAddresses:controller.view : 0];
    }
}