I have a UIViewController
that manages the display of some data. When the user wants to edit this data I push an edit UIViewController
onto the stack. When the user is finished editing the top view controller is popped off the stack. What is the most elegant way to know that I need to update my display after the edit view is popped off?
I thought that I might be able to put the content update code into the viewDidLoad
method of my data view, but this method isn't always called when my view displays, especially not when I'm navigating down the view stack.
I also considered setting up my data view controller as a delegate for the UINavigationController
and wait for – navigationController:didShowViewController:animated:
to be called, my concern is that there may be other view controllers that need to be notified when they're displayed and it will turn into a minor headache managing which controller should be receiving the didShowViewController
message.