Reputation: 16051
I want a button to have the same effect that pressing the back button in the navigation would have, where the view goes back to the last view.
How do i do this?
Upvotes: 1
Views: 620
Reputation: 47064
Add a method to your view controller:
-(IBAction)goBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
And add the button in IB, hook up the touchupInside
event to the newly added goBack:
method you just added.
Upvotes: 4