我一直在捕捉图像和视频的应用程序,然后通过MFMailComposer发送到邮件。我已经创建了内容和大小约6MB的zip文件。我想要显示加载视图,当用户点击发送按钮和隐藏邮件控制器,当邮件实际发送时,我想通过警报显示消息。有什么办法可以做到吗?任何帮助都将不胜感激。
发布于 2014-05-11 18:37:57
如果邮件已经发送,您可以使用MFMailComposeViewControllerDelegate方法获取信息:
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
}不要忘记将MFMailComposeViewControllerDelegate添加到.h文件中
https://stackoverflow.com/questions/23591502
复制相似问题