iOS UINavigationController跳转到指定页

2017-11-21  本文已影响0人  超人_22

UINavigationController类有个属性ViewControllers,这是一个数组,记录了导航栈中的ViewController,所以要跳转到指定的页面就要使用这个属性,代码如下:

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

if([vc isKindOfClass:[SearchUserViewController class]]) {

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

}

}

返回指定的N级navigationController 用下面代码:

上一篇 下一篇

猜你喜欢

热点阅读