title: iPhone set interfaceorientation programmatically
body: <p>I am trying to change the orientation of a single <code>UIViewController</code> programmatically. The user should choose in the settings if the view will be portrait or not. The value will be saved in <code>NSUserDefaults</code> and in the specific <code>ViewController</code> the orientation should be changed. So if Portrait is on the <code>interfaceOrientation</code> should be on <code>UIInterfaceorientationUpsideDown</code>......</p>
  
  <p>I used following method but it will only change the orientation when the user will turn the device to landscape/portrait... otherwise nothing will be triggered.</p>
  
  <pre><code>- (BOOL)shouldAutoRotateToInterfactOrientation:(UIInterfaceOrientation)interfaceOrientation
  </code></pre>
  
  <p>Furthermore i tryied the next one (also with method name "<code>setOrientation</code>"):</p>
  
  <pre><code>[[UIDevice currentDevice] orientation: UIDeviceOrientationPortraitUpsideDown];
  </code></pre>
  
  <p>But again, nothing happens, there just appear errors because xcode sayes there are no methods with this name.</p>
  
  <p>But ther should be another way to change it programatically...
  the first method is also just a method that handles the actionListener after device position but there should be a way to call this <code>actionListener</code> in a direct way....
  I just looked inside the <code>UIApplication</code> File but there is no usefull method....</p>