我想在导航堆栈上弹出到第三个 View 回到第一个 View 。
我知道如何一次弹出一个 View :
[self.navigationController popViewControllerAnimated:YES];
但是我怎样才能一次做两个呢?
最佳答案
您也可以尝试在导航 Controller 堆栈之间跳转
NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray:[self.navigationController viewControllers]];
for (UIViewController *aViewController in allViewControllers) {
if ([aViewController isKindOfClass:[RequiredViewController class]]) {
[self.navigationController popToViewController:aViewController animated:NO];
}
}
关于ios - 如何从导航 Controller 一次弹出两个 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8236940/