我有一个导航堆栈如下:
VcA -> VcB -> VcC
当我按下 VcC 导航栏上的后退按钮时,我想去 VcA。
我试过做[self.navigationController popToRootViewControllerAnimated:YES]
,但它首先弹出到 VcB,然后转到 VcA。
我也试过这个:
NSMutableArray *navigationArray = [[NSMutableArray alloc] initWithArray: self.navigationController.viewControllers];
[navigationArray removeObjectAtIndex: 1];
self.navigationController.viewControllers = navigationArray;
但它不起作用。它仍然先显示 VcB,然后显示 VcA。
viewWillDisappear
我在VcC中尝试了上述两个代码。
请帮助我如何解决这个问题。谢谢