Mail Composer broken in iOS 8.1

1.8k views Asked by At

Hy guys,

i running for my own tale for 4 hours now and i just realised that maybe i'm not crazy or stupid and that mail composer doesn't work in iOS8.1

So this is my code, nothing fancy:

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;

if ([MFMailComposeViewController canSendMail]) {
    //Setting up the Subject, recipients, and message body.
    [mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
    [mail setSubject:@"Subject of Email"];
    [mail setMessageBody:@"Message of email" isHTML:NO];
    //Present the mail view controller
    [self presentViewController:mail animated:YES completion:NULL]; }

In iOS 8.1 i am getting the mail window with the subject and the app crashes.

In iOS 7.1 i am getting the mail window with the subject and message body and all is good.

There is something that i'm missing in iOS8.1 or is this a bug?

Thank you

PS: It crashes because it can't complete the email either the recipient or the message body. Here's a part of the crash report:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument' terminating with uncaught exception of type NSException abort() called CoreSimulator 110.4 - Device: iPhone 5 - Runtime: iOS 8.1 (12B411) - DeviceType: iPhone 5  

Or:

<MFMailComposeRemoteViewController: 0x7c0c1e00> timed out waiting for fence barrier from com.apple.MailCompositionService

I imported the framework,the headers and did the delegate.

0

There are 0 answers