0

我试图让我的表格视图在选择单元格时呈现一个 mailcomposerviewcontroller。我试过使用:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
   MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;



// Set up recipients
if ([arryData objectAtIndex:0]) {
    [picker setSubject:@"To You"];

    NSArray *toRecipients = [NSArray arrayWithObject:@"emailaddress@here.com"];
    [picker setToRecipients:toRecipients];

    // Fill out the email body text
    NSString *emailBody = @"From Me";
    [picker setMessageBody:emailBody isHTML:NO];

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

然而,这让我崩溃了

which is waiting for a delayed presention of <MFMailComposeViewController:
4

2 回答 2

0

您的代码片段在这里似乎很好。如果您因此错过了某些内容,请再次执行这些步骤。

http://www.roseindia.net/answers/viewqa/Mobile-Applications/18176-iPhone-MFMailcomposeviewcontroller-example.html

我希望它对你有帮助!干杯!!

于 2012-09-21T04:19:23.150 回答
0

最好先检查设备是否配置为发送邮件。你可以看到这个 链接

于 2012-09-21T04:18:01.610 回答