1.当前视图控制器消失,并向左显示前一个视图
[self.navigationController popViewControllerAnimated:YES];
2.返回到根视图控制器
[self.navigationController popToRootViewControllerAnimated:YES];
3.返回到指定视图控制器(回到指定视图控制器,也就是不只弹出一个)
[self.navigationController popToViewController:viewController animated:YES];
例如:
[self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -3)] animated:YES];
for (UIViewController *controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[你要跳转到的Controller class]]) {
[self.navigationController popToViewController:controller animated:YES];
}
}