Skip to content

Instantly share code, notes, and snippets.

@paulstefanort
Created October 5, 2012 16:43
Show Gist options
  • Save paulstefanort/3840912 to your computer and use it in GitHub Desktop.
Save paulstefanort/3840912 to your computer and use it in GitHub Desktop.

Revisions

  1. paulstefanort created this gist Oct 5, 2012.
    14 changes: 14 additions & 0 deletions gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // (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];