4

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@email.com",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.

donio20
  • 75
  • 6
  • Provide details about the crash. What's the complete and exact error message? Where does your code crash? – rmaddy Nov 11 '14 at 20:32
  • Tested on iOS 8.1/iPad 2 simulator and it's working fine. – Viktor Kucera Nov 11 '14 at 20:48
  • Related: http://stackoverflow.com/questions/25604552/i-have-real-misunderstanding-with-mfmailcomposeviewcontroller-in-swift-ios8-in – Viktor Kucera Nov 11 '14 at 20:51
  • Thank you Viktor, i'll try it that way. But i can't understand why it's working in 7.1 and not in 8.1 Worst of all it seems that it's an old bug. – donio20 Nov 11 '14 at 20:57

0 Answers0