Created
October 5, 2012 16:43
-
-
Save paulstefanort/3840912 to your computer and use it in GitHub Desktop.
UINavigationController - switch directly from one view to another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (http://stackoverflow.com/questions/410471/how-can-i-pop-a-view-from-a-uinavigationcontroller-and-replace-it-with-another-i) | |
// locally store the navigation controller since | |
// self.navigationController will be nil once we are popped | |
UINavigationController *navController = self.navigationController; | |
/* Not necessary with ARC | |
// retain ourselves so that the controller will still exist once it's popped off | |
[[self retain] autorelease]; | |
*/ | |
// Pop this controller and replace with another | |
[navController popViewControllerAnimated:NO]; | |
[navController pushViewController:someViewController animated:NO]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment