You should try the other UINavigationBarDelegate
delegate method, –navigationBar:shouldPopItem:
, and return YES
after doing whatever you need to do. "Should" delegate methods are called before the thing happens. "Did" methods are called after it happens.
The method that you are calling is not for the back button. The back button will "Pop" a view controller. The opposite (which you are using) is to "Push" a view controller. A push adds a new view controller to the stack. A pop removes a view controller from the stack.
Also, make sure to conform to UINavigationBarDelegate
. If nothing happened with the delegate method that you used, something is set up wrong. AFAIK the delegate should be automatically set up if you are using a UINavigationController
.