views:

19

answers:

1

UINavigationController provides with default back button, which will pop the current view controller. I want to add my own handler to the back UIBarButtonItem and after that call the default code so it will pop the controller. I know that I can pop myself in the code, but just wondering if there is a way to call that default routine of framework, because there are similar situations.

A: 

I don't know of any documented method, the navigation controller takes care of many tasks and is meant to be used pretty much as is.

But to obtain a similar effect, I would override viewWillDisappear:animated. You then know that the back button (or other view dismissing button) was pressed by the user. I use this to hide the navigation bar before going back to the rootViewController.

David