HomeViewController *homeVC = [[HomeViewController alloc] init];
UIViewController *target = nil;
for (UIViewController * controller in self.navigationController.viewControllers) { //遍历
if ([controller isKindOfClass:[homeVC class]]) { //这里判断是否为你想要跳转的页面
target = controller;
}
}
if (target) {
[self.navigationController popToViewController:target animated:YES]; //跳转
}
如果知道是第几级界面,则用如下方法
UIViewController *viewCtl = self.navigationController.viewControllers[2];
[self.navigationController popToViewController:viewCtl animated:YES];