lundi 2 février 2015

Segue to a different Storyboard

I'm trying to make a custom segue from one storyboard to another, I use a button and this method



-(void)VCtoUrbaVC{
UIStoryboard *urbaStoryboard = [UIStoryboard storyboardWithName:@"BusUrbaStoryboard" bundle:nil];

UIViewController *urbaVC = [urbaStoryboard instantiateInitialViewController];
[self.navigationController pushViewController:urbaVC animated:YES];
}


but when I click the button in the simulator crashes saying "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'".


Debugging with breakpoints I found it does the execution of the metod OK but then it crashes.




Aucun commentaire:

Enregistrer un commentaire