How to access the stack in UINavigationController

Viewed 47879

viewControllers

The view controllers currently on the navigation stack.

@property(nonatomic, copy) NSArray * viewControllers

Discussion

The root view controller is at index 0 in the array, the back view controller is at index n-2, and the top controller is at index n-1, where n is the number of items in the array.

Assigning a new array of view controllers to this property is equivalent to calling the setViewControllers:animated: method with the animated parameter set to NO.

I am confused how to access the the stack I have three views in the navigation controller – root view controller, sti testing location, sti map.

How can I access the stack?

3 Answers
Related