在 iOS 中显示电子邮件提示时出现奇怪的断言失败
代码:
- (void)displayComposerSheet:(id)delegate withDataSource:(id)datasource {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.navigationBar.tintColor = self.navigationController.navigationBar.tintColor;
picker.mailComposeDelegate = 委托;
//使用数据源填写电子邮件字段
if ([[数据源收件人] 计数] > 0)
[picker setToRecipients:[数据源收件人]];
[选择器设置主题:[数据源主题]];
[picker setMessageBody:[datasource emailText] isHTML:[datasource isHTML]];
[[UIWindow topMostController] presentModalViewController:picker animated:YES];
[选择器成为FirstResponder];
[选择器发布];
}
MyApp[60324:907] *** -[MFMailComposeInternalViewController _endDelayingCompositionPresentation] 中的断言失败,/SourceCache/MessageUI/MessageUI-1075.10/Mail/MFMailComposeInternalViewController.m:316