我有一个有趣的问题。我的邮件撰写 View Controller 只显示主题,但没有正文或收件人。在代码中我确实设置了所有这些字段,但不知何故只有主题出现。
现在这确实发生在回调 block 中,但我不确定为什么这会对填充的内容产生影响。
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];
当我尝试更改任何字段时,我也会遇到此错误:
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x7fec540454d0 {Message=Service Connection Interrupted}
创建“全局”变量没有帮助:
@property (nonatomic, strong) MFMailComposeViewController *mailComposer;
最佳答案
我遇到了同样的问题,可能是您在使用新 Xcode 6 的模拟器时遇到了这个问题。* 请在设备中试用,它将正常工作!!!
关于ios - MFMailComposeViewController 显示空白字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26921932/