多次push之后回到指定控制器:假如指定的控制器为BTAddressZoneViewController
for (UIViewController *controller in weakSelf.navigationController.viewControllers) {//遍历导航控制器下所有的子控制器
if ([controller isKindOfClass:[BTAddressZoneViewController class]])
{
[weakSelf.navigationController popToViewController:controller animated:YES];
}
}
//回到上一级控制器
[weakSelf.navigationController popViewControllerAnimated:YES];
//回到最初push进来的控制器
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
网友评论