我有以下代码,在didSelectRowAtIndexPath中调用。问题是,当我点击取消按钮时,会提示保存草稿或放弃。但是当我点击其中任何一个后,视图并没有消失。我在之前iOS 5的应用程序中使用了相同的代码,而且视图可以正常消失。有什么想法吗?在接口中我有MFMailComposeViewController代理协议。
if (indexPath.row == 0)
{
if([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Support"];
NSArray *toRecipients = [NSArray arrayWithObject:@"contact@app.com"];
[picker setToRecipients:toRecipients];
NSString *emailBody = text;
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
}
}