gpt4 book ai didi

iphone - MFMailComposeViewController : exit on cancel

转载 作者:行者123 更新时间:2023-12-03 19:25:40 25 4
gpt4 key购买 nike

我有以下代码向用户展示应用程序内的电子邮件:

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Subject"];
NSString* link = [NSString stringWithFormat:@"<a href='%@'>Report</a>",link];
[picker setMessageBody:link isHTML:YES];
picker.navigationBar.barStyle = UIBarStyleDefault;
[self presentModalViewController:picker animated:YES];
[picker release];

还有:

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{ 
[self dismissModalViewControllerAnimated:YES];
}

一切正常,期望我希望取消跳过删除草稿/保存草稿/取消阶段并基本上选择删除草稿(不将其呈现给用户)这可以做到吗?谢谢

最佳答案

- (void)mailComposeController:(MFMailComposeViewController *) controller didFinishWithResult:(MFMailComposeResult) result error:(NSError *)error
{
switch (result) {
case MFMailComposeResultCancelled:
break;

case MFMailComposeResultSaved:
break;

case MFMailComposeResultSent:
break;

case MFMailComposeResultFailed:
break;

default:
break;
}

//Dismiss the mailViewController.
[self dismissModalViewControllerAnimated:YES];
}

这是您要找的吗?然后,您可以单独处理每个错误或完成!

关于iphone - MFMailComposeViewController : exit on cancel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3494930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com