Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target-Collection of common programming errors
I’m new in iphone, I’m trying to open a view when pressing a button, in my class “ReaderViewController” I wrote the following code:
- (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
}
I want when to open the view of this controller “SearchViewController” and in storyboard I gave the view of SearchViewController its identifier name “searchView” but when I run, it gives me the following Exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target .'
Any Help ?? Thanks in advanced.