I am trying to open a UINavigationController programmatically. Here is my code:
UIViewController *vc = [[UIStoryboard storyboardWithName:@"Storyboard"
bundle:nil] instantiateViewControllerWithIdentifier:@"ViewControllerID"];
UINavigationController *nc = [[UINavigationController alloc]
initWithRootViewController:vc];
nc.modalTransitionStyle = UIModalPresentationNone;
[self presentViewController:nc animated:YES completion:NULL];
I keep getting the following Error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
vcis actually aUINavigationControllerand not aUIViewController. You also shouldn't be settingmodalTransitionStyletoUIModalPresentationNone, that's not even the right type of enum. - dan