MFMailComposeViewController rendered with empty fields
I have an interesting problem. My mail view manager only appears with a subject, but no body or recipients. In the code I am setting all these fields, but somehow only the theme appears.
Now this is happening in the callback block, but I'm not sure why it affects what is being populated.
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject: @"test 12345"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:email];
[picker setToRecipients:toRecipients];
// Fill out the email body text
NSString *emailBody = @"test 1234";
[picker setMessageBody:emailBody isHTML:NO];
[self presentViewController:picker animated:YES completion:nil];
I also get this error when trying to change any fields:
viewServiceDidTerminateWithError: Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3 "Operation failed to complete. (Error _UIViewServiceInterfaceErrorDomain 3.)" UserInfo = 0x7fec540454d0 {Message = Service connection terminated}
Creating a "global" variable didn't help:
@property (non-atomic, strong) MFMailComposeViewController * mailComposer;
+3
source to share