1
我在我的應用程序中實現了MFMailComposeViewController,當我點擊我的郵件按鈕時,我得到了下面的錯誤。應用程序試圖在iOS 10中的目標上呈現一個無模式視圖控制器?
應用程序試圖在目標強大的文本呈現零模態視圖控制器
這裏是我的代碼:
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:@[@"[email protected]"]];
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];
這有什麼錯我的代碼。請幫忙
爲MFMailcomposerViewController @visible接口聲明的選擇 'canSendMail' 我收到此錯誤 –
嘗試編輯答案,有錯別字錯誤@ User558 –
我試過了,但它沒有進入IF循環 –