从SKScene中删除MFMailComposeViewController

时间:2014-03-19 15:03:06

标签: ios objective-c sprite-kit mfmailcomposeviewcontroller

我以这种方式从MFMailComposeViewController打开SKScene

-(void)sendmail {

if ([MFMailComposeViewController canSendMail]) {

    MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
    mailer.delegate = self;
    NSArray *recipients = [NSArray arrayWithObjects:@"nothing@gmail.com", nil];
    [mailer setToRecipients:recipients];

    UIViewController *vc = self.view.window.rootViewController;
    [vc presentViewController:mailer animated:YES completion:nil];
 }
}

这可行,但在我想要返回SKScene之后,委托方法未被调用且无法返回。

这是SKScene的.h:

 @interface SettingScene : SKScene <UINavigationControllerDelegate, MFMailComposeViewControllerDelegate>

出了什么问题?

感谢

1 个答案:

答案 0 :(得分:1)

设置,

mailer.mailComposeDelegate = self;

在展示邮件时。

谢谢!