从我的 navigationController 我有两条路径:
navigationController --> ViewControllerA -- ViewControllerB(当前显示)。
和导航控制器--> ViewController1-->ViewController2。
我想从 ViewControllerB 转到 ViewController2。
这是我尝试过的:
[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];
self.navigationController pushViewController 不起作用。
我在 App 委托中引用了 viewController1 并尝试了 [app.viewController1 pushViewControler animated:YES];,但这也不起作用。
你怎么解决这个问题?