From my navigationController I have two paths:
navigationController --> ViewControllerA -- ViewControllerB (currently showing).
and navigationController --> ViewController1 -->ViewController2.
I want to go from ViewControllerB to ViewController2.
Here's what I tried:
[self.navigationController popToRootViewControllerAnimated:YES]; // Works fine
AppDelegate app* = [[UIApplication sharedApplication] delegate];
LocationsViewController* locationsViewController = [[LocationsViewController alloc] initWithNibName:@"LocationsView" bundle:nil];
locationsViewController.title = @"Title";
[self.navigationController pushViewController:locationsViewController animated:YES];
The self.navigationController pushViewController doesn't work.
I have a reference to viewController1 in App delegate and tried [app.viewController1 pushViewControler animated:YES];, but that doesn't work either.
How do you solve this problem?