iOS 跳转到指定界面(一般都是回到上层节目)加回退到上上个页面

比如要跳转到BObleVC界面
引入BObleVC.h后
#import "BObleVC.h"
在需要的地方按钮或者触摸手势中加入
for (UIViewController *temp in self.navigationController.viewControllers){
            if ([temp isKindOfClass:[BObleVC class]]) {//BObleVC要跳转的界面
                [self.navigationController popToViewController:temp animated:YES];
            }
        }
 int index = (int)[[self.navigationController viewControllers]indexOfObject:self];//(index 本页面的标记,向前跳转的个数进行减少)
            [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:index-1] animated:YES];
原文地址:https://www.cnblogs.com/gaozhang12345/p/10329297.html