在之前用的presentViewcontroller用的比较多,但是解除了NavigationController之后看了下里面的方法,也有过看过里面的方法呀,

比如返回上一级的界面:[self.navigationController popViewControllerAnimated:YES];

返回的主界面的:[self.navigationController popToRootViewControllerAnimated:YES];

跳转到指定的界面:

NewConfigViewController *homeVC = [[NewConfigViewController 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]; //跳转

    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案