UINavigationController popToViewController用法

[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];

// 或

for (UIViewController *controller inself.navigationController.viewControllers) {
    if ([controller isKindOfClass:[XXXController(要跳回的Controller) class]]) {
        [self.navigationControllerpopToViewController:controller animated:YES];
    }
}

栈中抽取

    原文作者:Dean
    原文地址: https://segmentfault.com/a/1190000000652450
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞