So, I have a main menu, and when I click one button from the main menu, I want to display another ViewController, so I create a NavigationController, I add the ViewController to this NavigationController and try to display, but nothing happens. My code to push my new ViewController:
SubMenuViewController *subVC = [[SubMenuViewController alloc]initWithNibName:@"SubMenuViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] init];
[nav pushViewController:subVC animated:YES];
nav = nil;
This code is called in the MainViewController, when one button is pressed...
My SubMenuViewController creates a SplitViewController, with also two NavigationController, one for the table of the left, and the other for the table of the right, but these can't be the problem, right?
If you need more information to help me, please, tell me
The UINavigationController
that you are creating needs to be part of your view controller hierarchy. As you have it, you've just created it but not added it to anything. You'd probably be better served to create it at the top of your hierarchy and push sub-views onto it rather than trying to create it on the fly.