title: How should I manage swapping a UINavigationController in and out of another UIViewController?
body: <p>Here's what I have:</p>
  
  <ul>
  <li><p>A MainWindow.xib file configured with one UIViewController (subclassed to RootViewController).  This nib gets loaded at application launch.</p></li>
  <li><p>RootViewController has two ivars, a custom subclass of UIViewController and a UINavigationController.  Both of these are loaded from nibs.</p></li>
  </ul>
  
  <p>When the application launches both ivars are initialized from their respective nibs, and then the UIViewController.view is added as a subview of RootViewController.view.</p>
  
  <p>Inside UIViewController's view I have a control that triggers an animated swap of UIViewController and UINavigationController.  This is where the problem comes in.  The swap animates, but the UINavigationController's views are not properly displayed.  I get a Navigation Bar with no title, and nothing else.</p>
  
  <p>The UINavigationController nib and underlying functionality have been tested in a stand alone project, but there was no RootViewController.</p>
  
  <p>So, my question is, can I even do this?  I've successfully swapped other view controllers like this, but never a UINavigationController.  I've seen some documentation that leads me to believe this might be a fools errand, but I haven't convinced myself of that yet.</p>
  
  <p><strong>Solution (Kinda):</strong></p>
  
  <p>I found a solution (workaround? hack?), but it leads to some more questions.  I nixed using a Nib for the UINavigationController.  Instead, I loaded my UINavigationController's rootViewController from a Nib and then created the UINavigationController programmatically with initWithRootViewController:.</p>
  
  <pre><code>  NavRootViewController *navRoot = [[NavRootViewController alloc] initWithNibName:@"NavRootViewController" bundle:nil];
    navigationController = [[UINavigationController alloc] initWithRootViewController:navRoot];
    [navRoot release];
  </code></pre>
  
  <p>This works as I expect.  Which leads me to the conclusion that the rootViewController property of the UINavigationController wasn't being set properly when I loaded navigationController from a Nib.  And the question is, why?  Should it?</p>