title: Get UINavigationBar delegate to allow "back", with a nice animation
body: <p>Scenario on an iPhone:</p>
  
  <p>The user taps the back button, the <code>UINavigationBar</code> delegate method (implemented in a subclass of <code>UINavigationController</code>) returns <code>YES</code>, like this:</p>
  
  <pre><code>- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
  {
      // Verify stuff...
  
      return YES;
  }
  </code></pre>
  
  <p>Now, according to the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBarDelegate_Protocol/Reference/Reference.html" rel="noreferrer">docs</a>, it's the app's responsibility to keep the nav bar and the contents in sync, and the place to do that is in the delegate method</p>
  
  <pre><code>- (void)navigationBar:(UINavigationBar *)navigationBar didPopItem:(UINavigationItem *)item
  </code></pre>
  
  <p>The problem is, that <code>didPopItem</code> is only called after the nav bar's pop animation sequence is finished, so if I call <code>[self popViewControllerAnimated: NO]</code> there, the net result is that first the nav bar slides back, then the contents. </p>
  
  <p>And that just looks wrong.</p>
  
  <p>If I call the navigation controller's <code>pop...</code> in the delegate <code>shouldPop...</code> method, I get an error message to the effect that I am overlapping animations, and the final state is not clean.</p>
  
  <p>So my question is, is there another way to get the UINavigationController to change contents, preferably with a nice animation in sync with the nav bar's, but without creating confusion between the nav bar and the navigation controller?</p>
  
  <p>The target OS is iOS 4.2 and later.</p>
  
  <p>I am aware that I could just create another left button in place of the back button, but I found it cleaner to use a delegate, plus, I get a "real" back button, which is what I want.</p>