我是 iphone 新手,我试图在按下按钮时打开一个视图,在我的类“ReaderViewController”中,我编写了以下代码:
- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar emailButton:(UIButton *)button
{
#ifdef DEBUGX
NSLog(@"%s", __FUNCTION__);
#endif
#if (READER_ENABLE_MAIL == TRUE) // Option
instantiateViewControllerWithIdentifier:@"searchView"];
if (printInteraction != nil) [printInteraction dismissAnimated:NO]; // Dismiss
SearchViewController *searchController = [self.storyboard instantiateViewControllerWithIdentifier:@"searchView"];
searchController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
searchController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:searchController animated:YES];
[searchController release];
#endif // end of READER_ENABLE_MAIL Option
}
我想什么时候打开这个控制器“SearchViewController”的视图,在情节提要中我给 SearchViewController 的视图提供了它的标识符名称“searchView”,但是当我运行时,它给了我以下异常:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <ReaderViewController: 0x6864930>.'
有什么帮助吗??先谢谢了。