一、当返回上一个界面时,需要返回之前的某一个视图
//获取总的VC的数组
UINavigationController *nc = self.navigationController;
NSMutableArray *mArray = [NSMutableArray arrayWithArray:nc.viewControllers];
NSInteger count = mArray.count;
//获取上一个视图
BaseController *topVC = mArray[count - 2];
if ([topVC isKindOfClass:[OrderSettlementViewController class]]) {
[mArray removeObject:topVC];
}
self.navigationController.viewControllers = mArray;
网友评论