欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iOS 让导航控制器pop回指定的控制器

程序员文章站 2022-06-04 13:16:07
...
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:[self.navigationController viewControllers]];
for (UIViewController *myViewController in viewControllers) {
    if ([myViewController isKindOfClass:[RequiredViewController class]]) {
        [self.navigationController popToViewController: myViewController animated:YES];
    }
}

O(∩_∩)O~