gpt4 book ai didi

iphone - 应用程序试图在目标 上呈现一个无模态视图 Controller

转载 作者:行者123 更新时间:2023-11-29 11:08:43 25 4
gpt4 key购买 nike

我收到以下错误:

Application tried to present a nil modal view controller on target <UINavigationController: 0x2007af00>.

在下面的代码中:

-(void) showAddressBookDialog
{
[self presentMailComposeViewController:nil];
}


- (void)presentMailComposeViewController:(NSString *)recipient {
// Create the compose email view controller
MFMailComposeViewController *composeEmailViewController = [[MFMailComposeViewController alloc] init];
[composeEmailViewController setMailComposeDelegate:self];
[composeEmailViewController setSubject:@"Join me on X"];
[composeEmailViewController setToRecipients:[NSArray arrayWithObjects:recipient, nil]];
[composeEmailViewController setMessageBody:@"" isHTML:YES];
[composeEmailViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self dismissModalViewControllerAnimated:NO];
self.inviteFriendsMailComposerVC_ = composeEmailViewController;
//[self.navigationController presentModalViewController:composeEmailViewController animated:YES];
[self.navigationController presentViewController:composeEmailViewController animated:YES completion:nil];
[composeEmailViewController release];
}

知道为什么吗?

最佳答案

我想知道你为什么要首先关闭你的 View ...从你的方法中删除这一行

[self dismissModalViewControllerAnimated:NO];

最好先检查设备是否配置为发送电子邮件。看这个link

关于iphone - 应用程序试图在目标 <UINavigationController : 0x2007af00> 上呈现一个无模态视图 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12558910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com