I have a navigation-based application with the navigation-bar hidden but I still need a custom back button to the first view. My code is largely based on the answer in this example and this is the code that’s executed once my back button has been pressed by the user.
CreateViewController *createViewController = [[CreateViewController alloc] initWithNibName:@"CreateViewController" bundle:nil];
[self.navigationController pushViewController:createViewController animated:YES];
[createViewController release];
This does work but I’m not sure it’s the right way to do this. And one problem with this code is that the new view enters the screen from the right side. So even though it’s a back button, it seems as if it’s a new view that is appearing.
Any better ways to do this and fix the animation direction?
If I’m reading this correctly you should be using
popViewControllerAnimated:
instead of push. Pop will just bring it back to the previous view controller.