9

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?

Markus
  • 1,147
  • 16
  • 26
  • 1
    I have nearly the same, since I am using as well xcode6 and ios8, although it was working before, although I see the screen and have no crash - the setMessageBody does not work anymore for me ( [controller setMessageBody: tmpAnswers isHTML:YES]; ) – geebee Sep 14 '14 at 17:33
  • I updated my devices to iOS8 and they can send mails. I think it is a problem in the simulators of the Xcode6. Or maybe exists another new way to send mail. – Markus Sep 22 '14 at 19:29
  • It must be a bug, same with `UIActivityViewController` sharing to mail - working fine on device but not on any simulator – Christian Oct 02 '14 at 11:14
  • 1
    I downloaded the sample from Apple it has the same error though. Heres the [link](https://developer.apple.com/library/iOS/samplecode/MessageComposer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010161) If you run the sample code it has the same error. – otakuProgrammer Nov 03 '14 at 04:18

1 Answers1

1

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.

Community
  • 1
  • 1
Mirko Brunner
  • 2,204
  • 2
  • 21
  • 22