我收到以下错误:
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];
}
知道为什么吗?