self.navigationController push到指定控制器

葉喬木發表於2018-12-03
 1  返回到當前頁面上面第三級控制器

        int idx = (int)[[self.navigationController viewControllers]indexOfObject:self];            
        [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:(idx -3)] animated:YES];

2

        //遍歷跳轉目標控制器 進行跳轉
        for (UIViewController *controller in self.navigationController.viewControllers) {
            if ([controller isKindOfClass:[Task_Manage_VC class]]) {
                [self.navigationController popToViewController:controller animated:YES];
            }
        }

相關文章