navigationController中界面进入时层次关系是 主界面–>A–>B–>C 返回 时要求 C直接跳转至A
2、在C中,将navigationController的Views队列中的B删除,然后
popViewControllerAnimated,就可以直接返回到A了
代码如下:
NSMutableArray *viewsArray =[NSMutableArray arrayWithArray:self.navigationController.viewControllers];
[viewsArray removeObjectAtIndex:[viewsArray count]-2];
self.navigationController.viewControllers = [NSArray arrayWithArray:viewsArray];
[self.navigationController popViewControllerAnimated:YES];
网友评论