I want to be able to check for specific conditions when a user selects the “back” button from a navigation controller – then display an alert and stop the pop up the navigation stack from occurring.
I can get notified in the viewWillDissappear method that the pop is about to occur – but is there a mechanism to stop the pop from happening?
You can try subclassing UINavigationController and then override the popViewController method to include your logic.
[edit to include an example]
http://www.hanspinckaers.com/custom-action-on-back-button-uinavigationcontroller
Cheers,
Rog