I have 3 viewControllers
. viewController1
is linked to viewController2
(via segue id "first"), and viewController2
is linked to viewController3
(via segue id "destinationController"). I'm trying to segue from viewController1
to viewController3
. Here is my code:
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"DestinationController"];
[self.navigationController pushViewController:controller animated:YES];
It crashed with the following error:
'Storyboard (<UIStoryboard: 0x7fb1a944be00>) doesn't contain a view controller with identifier 'DestinationController''
How can I segue 2 viewControllers
without connecting the first to the last? (I prefer not adding a segue from the storyboard
because it will get very messy.)