MFMailComposeViewController问题 - 用户无法编辑邮件正文 - iPhone

时间:2011-03-19 20:33:11

标签: iphone objective-c email mfmailcomposeviewcontroller

我通常使用以下代码来允许用户提交有关我的应用的反馈。但由于某些原因,在我的OpenGL应用程序中,下面的代码有问题。它正确打开电子邮件表单,但表单被锁定 - 即用户无法实际编辑文本正文。任何人都能发现为什么会这样吗?

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

            [picker setSubject:@"Feedback on Stop That Bomb Free !"];
            NSArray *toRecipients = [NSArray arrayWithObject:@"anemail@gmail.com"]; 

            [picker setToRecipients:toRecipients];

            // Fill out the email body text
            NSString *emailBody =
            [NSString stringWithFormat:@"Hi Martin, I would like to make the following comment : "];

            [picker setMessageBody:emailBody isHTML:YES]; 

            picker.navigationBar.barStyle = UIBarStyleBlack; 

            [inputController presentModalViewController:picker animated:YES];
            [picker release];

1 个答案:

答案 0 :(得分:-2)

通过阅读您的代码,我可以找到一些您应该更改的内容:

替换:

NSString *emailBody = [NSString stringWithFormat:@"Hi Martin, I would like to make the following comment : "];

使用:

NSString *emailBody = @"Hi Martin, I would like to make the following comment : ";

因为您没有使用任何格式;你不需要调用类方法来创建简单的字符串。

您可以更改的另一件事是您的邮件不包含HTML。

所以你不需要isHTML:YES

我已经在示例应用上成功测试了这个。

我想问题是视图控制器呈现视图,而不是messageUI视图。