Ios – Programmatically call navigation controller back button on iOS

buttoniosobjective cuinavigationcontroller

In a UINavigationController-based iPhone app, in a method I would like to perform the programmatic equivalent of the back button being pressed and going back a view.

i.e. automatically press the Jobs button as seen here:

Navigation Controller image

Is there a generic iOS call I can make, or is more information required?

Best Answer

UINavigationController's -popViewControllerAnimated: method should do what you want:

[navigationController popViewControllerAnimated:YES];