Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to clear or resetting UINavigation history?
    text
    copied!<p>I have a game setup screen which uses UINavigation and am trying to reset or clear the UINavigation once a person has selected a color.</p> <p>My app's current process can be best described in the following diagram:</p> <pre><code>Start application -&gt; New game -&gt; Pick character -&gt; Pick Color -&gt; Start game </code></pre> <p>Up until "Pick Color" I use the UINavigation, however when a color is picked I want to clear the UINavigation history.</p> <p>The reason for doing this is so that you can't go back once you've started the game and want the UINavigation to with a clean slate with no indication that you can go back (and this also includes going back to the <code>main menu</code> screen).</p> <p>The way I am doing it right now is thusly;</p> <pre><code>[self.navigationController popToRootViewControllerAnimated:YES]; GameDashboardVC *dashboard = [[GameDashboardVC alloc] initWithNibName:@"GameDashboardVC" bundle:nil]; dashboard.title = @"Dashboard"; dashboard.managedObjectContext = self.managedObjectContext; [self.navigationController pushViewController:dashboard animated:YES]; [dashboard release]; </code></pre> <p>The problem is that it pops to the rootViewController but it never pushes the dashboard onto the stack.</p> <p>I've tried:</p> <pre><code>[self.parentViewController.navigationController pushViewController....] </code></pre> <p>The only thing I haven't tried is putting my dashboard push inside the root view controller itself, but I am concerned because I am not sure if it should even be there.</p> <p>Therefore, where is the correct place to put this kind of functionality, and how do I clear the UINavigation's stack.</p> <p>Thank you for your time/help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload