Go back 1 step in navigationbar?
I want a butt开发者_如何学运维on 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?
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.
精彩评论