How to press “Back” button in UINavigationController programmatically

Simply use

[self.navigationController popViewControllerAnimated:YES]

from FriendsDetailedViewController. Your view will be popped out i.e. the behavior of back button.

Note that it returns UIViewController on normally, and returns nil if there is nothing to pop.

Leave a Comment