title: presentModalViewController not working properly
body: <p>I have 3 views.</p>
  
  <p>I want to do the following:</p>
  
  <pre><code>A presents B modally
  A dismisses B
  A presents C modally
  </code></pre>
  
  <p>I have setup a delegate pattern where A is B's delegate. This is how I am presenting and dismissing in B:</p>
  
  <pre><code>[delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO]
  [delegate presentC]; //this is just [self presentModalViewController:c animated:NO];
  </code></pre>
  
  <p>For some reason my app crashes when I execute this code with no debugger results (I have NSZombieEnabled).</p>
  
  <p>When I comment out <code>[delegate presentC]</code> the app will dismiss B properly. <strong>When I comment out <code>[delegate dismissB]</code> the app does nothing, even though the line executes.</strong> I am not sure why?</p>
  
  <p><strong>UPDATE:</strong>
  Here is the code in A</p>
  
  <pre><code>-(void)showARView{
      [self dismissModalViewControllerAnimated:NO];
  
      ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease];
      UINavigationController *arNavController = [[UINavigationController alloc] initWithRootViewController:arViewController];
  
      LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease];
      lbViewController.title = @"Leaderboard";    
      UINavigationController *lbNavController = [[UINavigationController alloc] initWithRootViewController:lbViewController];
  
      arTabBarController = [[UITabBarController alloc] init];//initWithNibName:nil bundle:nil];
      arTabBarController.delegate = self;
      arTabBarController.viewControllers = [NSArray arrayWithObjects:arNavController, lbNavController, nil];
      arTabBarController.selectedViewController = arNavController;
  
      [arNavController release];
      [lbNavController release];
  
      [self presentModalViewController:arTabBarController animated:NO];
  }
  </code></pre>
  
  <p>Here is the code in B</p>
  
  <pre><code>[delegate showARView];
  </code></pre>