Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 MFMailComposeViewController does NOT work

Tags:

xcode6

ios8

I try to upgrade my App to iOS 8. App runs perfect in iOS 7 and iOS 6 (In my iPhone and iPad).

But in iOS 8 NOT (iPhone 6 simulator).

And NOT in iPhone 5 simulator and any iPhone simulator (Xcode 6.0)

I simply try to send mail.

    MFMailComposeViewController *mailComp = [[MFMailComposeViewController alloc]init];
    mailComp setMailComposeDelegate:self];
    if ([MFMailComposeViewController canSendMail]) {
        [mailComp setSubject:@"Subject test"];
        [mailComp setMessageBody:@"Message body test" isHTML:NO];
        [self presentViewController:mailComp animated:YES completion:nil];
    }

    - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {

        if (error) {
            // Error handling 
        }
        [self dismissViewControllerAnimated:NO completion:nil];
    }

The error message:

Is not a valid email address.

ViewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed.

{Message=Service Connection Interrupted}

I have observed that in iPhone 6 Simulator you can not create a Gmail Account but I have created an iCloud Mail Account (New feature, I think)

I do not know if this is the problem. Please, Is there anyone in this situation?

like image 466
Markus Avatar asked Sep 12 '14 16:09

Markus


1 Answers

Look at this topic: MFMailComposeViewController dismisses right away

The response from Max seems to deal with this problem. It´s not the mail address or the mail account.

like image 175
Mirko Brunner Avatar answered Nov 11 '22 03:11

Mirko Brunner