ios界面跳转pop到指定的视图控制器

1、

for (UIViewController *controller in self.navigationController.viewControllers) {

if ([controller isKindOfClass:[GoodsDetailViewController class]]) {

GoodsDetailViewController *vc = (GoodsDetailViewController *)controller;

[self.navigationController popToViewController:vc animated:YES];

}

}

2、

UIViewController *controller = self.navigationController.viewControllers[1];

[self.navigationController popToViewController:controller animated:YES];

你可能感兴趣的:(ios界面跳转pop到指定的视图控制器)