title: Upgrading to iOS 6 and RootViewController Orientation Incorrect
body: <p>I am upgrading a legacy app to iOS 6, which only supports landscape orientation. When I run the app in the iPhone simulator or on my iPhone 4, the orientation of the root view controller is in portrait mode when it is supposed to be in landscape right. The keyboard is in the correct position initially, however. In addition, when I rotate the device, the keyboard sticks to its initial orientation, and the root view never changes orientation.</p>
  
  <p>In the Supported Interface Orientations section of the project settings, the Landscape Left and Landscape Right buttons are selected. In the pList file, Landscape (right home button) is set for Initial Interface Orientation, and Landscape (right home button) and Landscape (left home button) are set for Supported interface orientations.</p>
  
  <p>Also, in the root view controller, I have replaced this code:</p>
  
  <pre><code> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  // Return YES for supported orientations.
  BOOL rotate = NO;
  
  if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
      rotate = YES;
  
  return rotate;
   }
  </code></pre>
  
  <p>With this code:</p>
  
  <pre><code> - (NSUInteger)supportedInterfaceOrientations {
  
  return UIInterfaceOrientationMaskLandscape;
  
   }
  
   - (BOOL)shouldAutorotate {
  
  return YES;
  
   }
  </code></pre>
  
  <p>Any ideas?</p>