1. iOS返回跳到指定控制器
// 返回指定控制器
for (UIViewController *controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[InboxViewController class]]) {
[self.navigationController popToViewController:controller animated:YES];
}
}
2. 移除指定控制器
方法a:
NSArray* tempVCA = [self.navigationController viewControllers];
for(UIViewController *tempVC in tempVCA)
{
if([tempVC isKindOfClass:[urViewControllerClass class]])
{
[tempVC removeFromParentViewController];
}
}
方法b:
NSMutableArray *navigationArray = [[NSMutableArray alloc] initWithArray: self.navigationController.viewControllers];
[navigationArray removeObjectAtIndex: 2];
self.navigationController.viewControllers = navigationArray;
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者