0
votes

I have been using navigation view controller for some time now, and it really does great job. Problem is I don't fully understand it. Maybe some experienced members can shed some light on this topic. I have several questions:

1) Every class that extends UIViewController, has a property navigationController. Apple doc states this -"Only returns a navigation controller if the view controller is in its stack". Does this mean that this property is nil, if this controller is root controller.

2) When using method [self.navigationController pushViewController:nextController animated:YES] nextController is pushed to stack. If you then call self.navigationController inside nextController will navigationController property be nil?

3) Does every navigationController have its own stack, or there is shared stack for all controllers?

4) Finally what happens to items on the stack if you dont pop them, but release navigation controller? Lets say you do push, push, push, and then do release on navigationController. Do these objects stay on the stack or are they destroyed?

1

1 Answers

1
votes

1) yes 2) no 3) Every navigationController have its own stack 4) When you push a view controller, navigation controller retains it. When navigation controller is released, then it releases all view controllers in the stack.