[self.navigationController pushViewController:view animated:YES];
viewControllers:// The current view controller stack.
如何一个导航栏控制器push了十几个页面,你想获取这是几个页面的话,那么就可以通过* viewControllers*来查看。
另外还有一个属性可以获取childViewControllers,该属性也是返回一个数组,但是两者还是有些区别的。
- childViewControllers是属于UIViewController的属性,而viewControllers属于UINavigationViewController的属性
- childViewControllers不包含presented进来的控制器 官方API:
This property does not include any presented view controllers. This property is only intended to be read by an implementation of a custom container view controller.
网友评论