title: iPhone SDK: Orientation (Landscape and Portrait views)
body: <p>Okay, I've got my normal app which is in portrait mode. I can force my app to go to landscape mode for a view (using navigationcontroller and viewcontroller) like this:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
      [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
  }
  </code></pre>
  
  <p>But then when I go back to the main menu (tableview) it goes straight back to portrait. I try this code:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
      [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
  }
  </code></pre>
  
  <p>But that doesn't work..</p>
  
  <p>Any ideas?</p>