iOS开发笔记-38: controller控制器跳转(self.navigationController.viewControllers)

//界面跳转路径不包含自己这个controller

NSMutableArray *marr = [[NSMutableArray alloc]initWithArray:self.navigationController.viewControllers];
for (UIViewController *vc in marr) {
if (vc == self) {
[marr removeObject:vc];
break;
}
}
self.navigationController.viewControllers = marr;

//跳转指定控制器
for (UIViewController *VC in self.navigationController.viewControllers) {
    if ([VC isKindOfClass:[LoginViewController class]]) {
        [self.navigationController popToViewController:VC animated:YES]
    }
}

你可能感兴趣的:(iOS开发笔记-38: controller控制器跳转(self.navigationController.viewControllers))