0

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}

 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];
}
Rohit Kumar
  • 877
  • 6
  • 20
Monika Patel
  • 2,287
  • 3
  • 20
  • 45
  • 1
    possible duplicate of [I have REAL misunderstanding with MFMailComposeViewController in Swift (iOS8) in Simulator](http://stackoverflow.com/questions/25604552/i-have-real-misunderstanding-with-mfmailcomposeviewcontroller-in-swift-ios8-in) – Anbu.Karthik Aug 25 '15 at 10:56

1 Answers1

0

Have you tested on real devices? This usually comes in iPhone simulators.

Rohit Kumar
  • 877
  • 6
  • 20