This was, and is still working fine in iOS 7.1 (simulator and device). However after recently upgrading my Xcode to version 6, I tested the e-mail composition functionality and it no longer works. The body of the message does not show up. Here is some of the code pertaining to this functionality. I know similar questions have been brought up but none that matched my situation exactly.
#import <MessageUI/MessageUI.h>
@interface ServiceViewController ()<MFMailComposeViewControllerDelegate>
-(void)showEmailView {
NSString *vehicleLog = [self getCoreVehicles];
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Vehicle Log"];
[self.shareImageData enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
[picker addAttachmentData:[obj objectForKey:@"image"] mimeType:@"image/png" fileName:[obj objectForKey:@"name"]];
}];
[picker setMessageBody:vehicleLog isHTML:YES];
picker.navigationBar.barStyle = UIBarStyleBlack;
[self presentViewController:picker animated:YES completion:^{
self.selectedRecords = Nil;
}];
}
The error is:
2014-09-30 13:22:35.363 App[4919:356300] _serviceViewControllerReady:error: Error Domain=_UIViewServiceErrorDomain Code=1 "The operation couldn’t be completed. (_UIViewServiceErrorDomain error 1.)" UserInfo=0x7aa37f20 {Canceled=service continuation}
If I tap on the area where the body should have been, the mail composer quits with an extra error.
2014-09-30 17:50:11.343 App[6055:429122] timed out waiting for fence barrier from com.apple.MailCompositionService
I downloaded the sample code from https://developer.apple.com/library/ios/samplecode/MessageComposer/Listings/main_m.html#//apple_ref/doc/uid/DTS40010161-main_m-DontLinkElementID_8 and same issue.
If anyone has faced something similar, or any tips, please let me know.