如何让self.navigationController退出到指定页面,或者让它一次性pop出两个页面popViewControllerAnimated没有

2017-09-14 11:35:52来源:CSDN作者:u010960265人点击

分享
HomeViewController:为你想要跳转的界面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]; //跳转  
                  }

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台