首页 > 代码库 > 控制器之间的跳转,多层的跳转

控制器之间的跳转,多层的跳转

UIViewController *target = nil;
for (UIViewController * controller in self.navigationController.viewControllers) { //遍历
if ([controller isKindOfClass:[SecretGardenController class]]) { //这里判断是否为你想要跳转的页面
target = controller;
}
}
if (target) {
[self.navigationController popToViewController:target animated:YES]; //跳转
}

控制器之间的跳转,多层的跳转