I’m trying to go back into a ViewController using popoverviewcontroller, but nothing happens.
First, I’m loading the first ViewController, in the AppDelegate, with this code:
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:self.welcomeMenu];
nav.navigationBarHidden = YES;
self.window.rootViewController = nav;
nav = nil;
The navigationBar is hidden because I need it in that way
In this ViewController, I’m showing a menu with buttons, then, to show another ViewController, I’m using this code:
SecondViewController *secView = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController:secView animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
secView = nil;
And the SecondViewController loads (but the rotation doesn’t work)…
My SecondViewController adds in code a SplitViewController (with a NavigationController for the Table on the left, and another NavigationController for another table on the right)
Then, in the SecondViewController, I’m adding manually a button to go back, using this code:
[self.navigationController popViewControllerAnimated:NO];
but nothing happens…
When I print self.navigationController, the output is (null), so I guess this is the problem, but why my self.navigationController is null? And What I need to do to pop correctly?
If I don’t hide the navigationBar in the AppDelegate code, the backButton that appears automatically works fine, but when I want to do it, manually, does not work…
You cannot load a split view controller from your SecondViewController.
See Split View Controllers: