【发布时间】:2016-09-21 06:56:12
【问题描述】:
当我点击我的邮件按钮时,我正在我的应用程序中实现 MFMailComposeViewController 我收到以下错误。
应用程序试图在目标强文本上呈现一个零模式视图控制器
这是我的代码:
NSString *iOSVersion = [[UIDevice currentDevice] systemVersion];
NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSString * build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
mailComposer = [[MFMailComposeViewController alloc]init];
mailComposer.navigationBar.tintColor = [UIColor blackColor];
[mailComposer.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor blackColor]}];
mailComposer.mailComposeDelegate = self;
[mailComposer setSubject:@"Co - Contact Us"];
[mailComposer setToRecipients:@[@"contact@co.org"]];
NSString *supportText = @"Enter your comment here:\n\n\n\n\n";
supportText = [supportText stringByAppendingString:[NSString stringWithFormat:@"iOS Version: %@\nCorner Version:%@\nBuild:%@\n\n",iOSVersion,version, build]];
[mailComposer setMessageBody:supportText isHTML:NO];
[self presentViewController:mailComposer animated:YES completion:nil];
我的代码有什么问题。请帮忙
【问题讨论】:
标签: objective-c mfmailcomposeviewcontroller ios10 presentviewcontroller