比如要跳转到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];