Assuming by your use of "push
" you mean that you are using a UINavigationController
, then you can use the following to return to the top of the stack.
[self.navigationController popToRootViewControllerAnimated:YES];
or
UIViewController *prevVC = [self.navigationController.viewControllers objectAtIndex:<n>];
[self.navigationController popToViewController:prevVC animated:YES];
to pop to a specific level where <n>
is the level.
or
[self.navigationController popViewControllerAnimated:YES];
If you just want to pop one level back up the navigation stack.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…