title: Iphone development viewcontroller portrait to landscape no autorotate
body: <p>I have a viewcontroller that's pushing another vc that should be in landscape mode but it does not autorotate to landscape when pushed ie. still in portrait.</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
  
      if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
          return YES;
      }
  
      return NO;
  }
  </code></pre>
  
  <p>When a popping the vc and back to the first controller all is perfect, it only displays in portrait mode only.</p>
  
  <p>I can get the second vc to rotate by rotating the phone/emulator and then stick to the autorotate landscape. Then also perfect when popping, returns to portrait mode.</p>
  
  <p>So is there any way to maybe progamaticly rotate the interface to landscape. Have tried using</p>
  
  <pre><code>[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
  </code></pre>
  
  <p>But to no great success. Statusbar then stuck in landscape when popping.</p>