I can pop a view controller from a UINavigationController
's stack by calling [self.navigationController popViewControllerAnimated:YES];
either from the parent view controller that instantiated it, or from the child view controller itself. Which way is preferable?
I suppose the answer is "whatever makes the most sense"; as you said, you can call popViewControllerAnimated:
from the parent, child, or even some other class that holds a reference to the navigation controller.
For most apps, the child view will contain a "back" or "done" button or some other action that then leads to it being popped. Generally, I would say this is the preferable behaviour: the child view controller pops itself.
Otherwise, the child would have to call out to the parent (via a delegate or something) to say "pop!" which would then call popViewControllerAnimated:
. This feels a little too convoluted for such a simple action.