您可以使用popToRootViewControllerAnimated:或popToViewController:animated:方法.
要获取需要跳转的viewcontroller,请从数组中的navcontroller获取所有viewcontroller的列表,然后从该数组中选择viewcontroller.
即如果您的层次结构是svc-> svc2-> vc1-> vc2-> vc3-> vc4并且您想从vc4返回vc1,请执行此操作
NSArray *viewControllers = [[self navigationController] viewControllers]; UIViewController *controller = [viewControllers objectAtIndex:2]; [[self navigationController] popToViewController:controller animated:YES];