title: Custom NavigationBar
body: <p>I have a Navigation Controller as the root of my app and I am using the appearance proxy to customise the look on iOS 5, but for iOS 4 I was hoping to use a category to override drawRect:, this was fine, except that all the Navigation bars were affected as you would expect from a category. </p>
  
  <p>I don't want to tamper with the "system" popups, such as the Mail composer, or the SMS composer, I want their bars to stay blue and system-like.</p>
  
  <p>I Tried to create my own UINavigationController with it's xib and change the class of the NavigationBar to my custom sub lass of UINavigationBar. But the results are not taking affect at all on screen.</p>
  
  <p>I am aware of the following post but couldn't get any solutions to run as expected.
  <a href="https://stackoverflow.com/questions/6672229/how-to-subclass-uinavigationbar-for-a-uinavigationcontroller-programatically">How to subclass UINavigationBar for a UINavigationController programmatically?</a></p>
  
  <p>My first attempt which does work but uses an undocumented setNavigationBar: method:</p>
  
  <pre><code>_myNavigationController = [[UINavigationController alloc] initWithRootViewController:someVC];
  
  if([[BT_NavigationController class] respondsToSelector:@selector(appearance)]){
  
      // some iOS 5 magic in here !
      [_myNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"topbar.png"];
  
  }else{
  
      // Probably looking at app store refusal 
      CustomBar * bar = [[CustomBar alloc] init];
      // [_myNavigationController setNavigationBar: bar];
      [bar release];
  
  }
  
  [parentView presentModalViewController:_myNavigationController animated:YES];
  </code></pre>
  
  <p>To avoid that I created a UINavigationController, which I also had a xib for, reassigning the class of the navigation bar to my custom class, but placing breakpoints in drawRect: method, I can see that this isn't being called.</p>
  
  <p>Why would that be, it seems that my code is not loading the nib, and therefore not realising the nab bar should be my custom class and not the UINavigationBar.</p>
  
  <p>Any tips would be helpful, thanks.</p>