Reputation: 12607
How can I get any controller in UINavigationController? I can easily get top controller using the property topViewController; How can i get for example top -1 ?
Upvotes: 1
Views: 4700
Reputation: 1003
There is a property of UINavigationController namely "viewControllers" which will work as follows:
NSArray *controllers = [navController viewControllers];
And now you can access any view controller from the returned array!
Upvotes: 7
Reputation: 558
By accessing the viewControllers property of UINavigationController you will get an array of pushed viewControllers So now you can access any viewController by indexing array.
Upvotes: 1