[英]Unable to send mail using MFMailComposeViewController in iOS
I got an error : 我有一个错误:
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn't be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x7c3f4600 {Message=Service Connection Interrupted} viewServiceDidTerminateWithError:错误域= _UIViewServiceInterfaceErrorDomain代码= 3“操作无法完成。(_ UIViewServiceInterfaceErrorDomain错误3。)” UserInfo = 0x7c3f4600 {Message =服务连接中断}
if([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
[mail setSubject:@"Contact"];
[mail setMessageBody:@"Here is some main text in the email!" isHTML:NO];
[mail setToRecipients:@[self.salonemail.text]];
[self presentViewController:mail animated:YES completion:NULL];
}
else{
[self showAlert:@"Looks like your device can't send emails"];
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
[self dismissViewControllerAnimated:YES completion:NULL];
}
Have you tested on real devices? 您是否在真实设备上进行过测试? This usually comes in iPhone simulators.
通常在iPhone模拟器中提供。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.