有些情况下,并不是简单的push pop,需要连跳几个VC,可以用下面的方法:
for(UIViewController * vc in self.navigationController.childViewControllers){
if([vc isKindOfClass:(NSClassFromString(@"指定的ViewController"))]){
[self.navigationController popToViewController:vc animated:YES];
break;
}
}