MFMailComposer与iPhone 5有关

时间:2012-12-17 19:02:49

标签: objective-c xcode

是否有新方法为iPhone 5提供MFMailComposeViewController?我正在使用4和5并排4个礼物/正常工作,但对于5它甚至没有命中代码:

if ([MFMailComposeViewController canSendMail]) {

    MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
    mailViewController.mailComposeDelegate = self;
    [mailViewController setToRecipients:[NSArray arrayWithObject:@"support@myemail.com"]];
    [mailViewController setSubject:@"Feedback"];
    [mailViewController setMessageBody:@"" isHTML:NO];

    [self presentModalViewController:mailViewController animated:YES];
    [mailViewController release];
}

2 个答案:

答案 0 :(得分:1)

您的邮件是否已设置为iPhone5?

答案 1 :(得分:0)

奇怪的是,它在iPhone 5上对我来说非常完美!

MFMailComposeViewController *mailVC = [MFMailComposeViewController mailComposeViewControllerWithRecipe:self.recipe];
if (mailVC) {
    mailVC.mailComposeDelegate = self;
    [self presentModalViewController:mailVC animated:YES];
}

究竟是什么意思“它甚至没有打到代码”?也许是你的

([MFMailComposeViewController canSendMail])

在某个地方是假的或有问题