title: Using setViewController from UINavigationController on iPhone doesn't behave properly
body: <p>I'm having a problem with an iPhone App using UINavigationController. When I'm using pushNavigationController, it works fine. The iPhone does its animation while switching to the next ViewController. But when using an array of ViewControllers and the setViewControllers method, it has a glitch in the animation which can grow into a clearly visible animation bug.</p>
  
  <p>The following snippet is called in the root ViewController. Depending on a condition it should either switch to ViewController1, or it should directly go to ViewController2. In the latter case the user can navigate back to vc1, then to the root.</p>
  
  <pre><code>NSMutableArray* viewControllers = [NSMutableArray arrayWithCapacity:2];
  // put us on the stack
  [viewControllers addObject:self];
  // add first VC
  AuthentificationViewController* authentificationViewController =
    [[[AuthentificationViewController alloc] initWithNibName:@"AuthentificationViewController" bundle:nil] autorelease];
  [viewControllers addObject:authentificationViewController];
  
  if (someCondition == YES)
  {
   UserAssignmentsListViewController* userAssignmentsListViewController =
        [[[UserAssignmentsListViewController alloc] initWithNibName:@"UserAssignmentsOverviewViewController" bundle:nil] autorelease];
  
   [viewControllers addObject:userAssignmentsListViewController];
  }
  
  [self.navigationController
    setViewControllers:[NSArray arrayWithArray:viewControllers] animated:YES];
  </code></pre>
  
  <p>As you can see I'll add the first and maybe the second VC to the array, finally setting the navigationController stack with animation. This works properly if I only add the first controller. But in the case where the animation should go to the 2nd controller, the navigation bar's title won't be "flying in". Instead there is an empty title until the animation is finished. And, even worse, if I replace the navbar title with a custom button, this button will be displayed in the upper left corner until the animation is finished. That's quite a displaying bug.</p>
  
  <p>I tried to use a workaround with multiple pushViewController methods, but the animation doesn't look / feel right. I want the navigation to do its animation in the same way as pushViewController does. The only difference here is, that I don't add a VC but set the whole stack at once. Is there another workaround here, or could this be considered as a framework's bug? I thought about using only pushNavController for VC2, then somehow insert VC1 into the stack, but that doesn't seem possible.</p>
  
  <p>Thanks for all hints and advices. :-)</p>
  
  <p>Technical data: I'm using iOS 4.2, compiling for 4.0.</p>