I’m using Storyboards and I basically have this:

It’s a mapView that presents modally a UINavigationController with a UIViewController subclass as its contentViewController (Location). Then that LocationViewController pushes another viewController based on the table selection (EditLocation).
In EditLocation, I want to pass back information when popViewController is called. I thought that I could use the UINavigationControllerDelegate to do that. So in Location, I try:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"ShowEditLocation"]) {
UIViewController *destination = segue.destinationViewController;
if ([destination respondsToSelector:@selector(setDelegate:)]) {
[destination setValue:self forKey:@"delegate"];
}
}
}
This Location class conforms to the UINavigationControllerDelegate protocol. However I never get the willShowViewController or didShowViewController callbacks from the UINavigationController protocol. Thoughts? Thanks!
The prepareForSegue method is invoked whenever a segue is about to take place.I tried accessing navigationController in viewDidLoad of MapViewController(means the viewController which loads when any cell in tableview is selected) and i got the proper description for that as follows.