title: pushing nil rootViewController onto target <UINavigationController
body: <p>I've been researching this all day but I haven't found anything about the rootViewController in relation to this error message. I know what the problem is but have no idea how to fix it. My problem is that my window.rootViewController is not connected or shows null and I can't figure out what to do. I've tried everything I could think of in code and in IB, but bad things happen whenever I change something. This is the message I get: "Application tried to push a nil view controller on target UINavigationController"</p>
  
  <p>I can see the window.rootViewController from an NSLog statement:
  "window.rootViewController : (null)"</p>
  
  <p>of course, everything was working perfectly before upgrading my Xcode to 4.2 and ios5. :)</p>
  
  <p>btw - the view loads but I cannot work any of the buttons, they do not light up at all. And my navigation works fine too.</p>
  
  <p>here is my appDelegate</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  
  [DDLog addLogger:[DDTTYLogger sharedInstance]];
  NSLog(@"Viewcontroller : %@", self.viewController);
  
  // Set the view controller as the window's root view controller and display.
  //self.window.rootViewController = self.viewController;
  //do it this way, previous version not supported in ios5 - may need to check version for compatibility
  [self.window addSubview:self.viewController.view];
  
  //set up navigation controller
  NSLog(@"window.rootViewController : %@", self.window.rootViewController);
  navigationController = [[UINavigationController alloc]
                          initWithRootViewController:self.window.rootViewController];
  navigationController.navigationBarHidden = YES;
  
  NSLog(@"navigationController : %@", navigationController);
  [window addSubview:navigationController.view];
  [window makeKeyAndVisible];
  
  //force this view to be landscape
  [application setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:NO];
  [self.navigationController.view setTransform: CGAffineTransformMakeRotation(M_PI / 2)];
  [self.navigationController.view setFrame:CGRectMake(0, 0, 748, 1024)];
  [UIView commitAnimations];  
  
  
  return YES;
  </code></pre>
  
  <p>}</p>
  
  <p>Thank you. </p>