In my current iPhone application, I开发者_JAVA百科 have four views. I would like to move from the first view to any of the three other views.
In one of these second views, how would I create a button that takes me back to the first view?
I suggest using a UINavigationController:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html
http://www.idev101.com/code/User_Interface/UINavigationController/
Also if you have a button that is not on the navbar that you want to act as your "back" button, you can always pop the current view. Something like
- (IBAction)back:(id)sender {
[self.navigationController popViewControllerAnimated:YES];
}
This should work on a UIViewController which is on top of a UINavigationController.
精彩评论