0

您如何查看使用 UINavigation 从堆栈中的 rootViewController 中删除了多少层?

4

1 回答 1

0

This depends on how your view hierarchy is setup. If you root view controller is a navigation controller and all you have done is pushed view controllers on to the navigation controller then simply look the 'viewControllers` property of the navigation controller. Its count tells you how many view controllers have been pushed.

NSUInteger count = [self.navigationController.viewControllers count];

It gets a bit more complicated if you have presented any modal controllers onto the stack.

于 2013-11-17T04:24:31.920 回答