Reputation: 11
Is it possible to decide the number of hierarchical level dynamically in UINavigationController in iPhone ? Actually, in my application I have to display hierarchical data but I don't know the number of levels at the coding time. The number of levels can be increase or decrease. The exact number of levels will known to me at the time of display. Please suggest the related code if possible.
With regards,
anurag85
Upvotes: 0
Views: 531
Reputation: 4875
I think you misunderstood some concept of navigation controller.
When navigation controller is created you push the first (root) controller that is viewed. When user performs some action, you create another controller and push it into the hierarchy with pushViewController:animated:
. From that screen you can again create and push another one, then another and so on. When user wants to come back, he can use navigation bar's "Back" button. As he is navigating back, those controllers are being released and possibly deallocated (if you did not retain them for possible reuse).
Upvotes: 0