title: Force UiInterfaceOrientation from Landscape to Portrait?
body: <p>I know may be it's a duplicate question, but I tried many answers described here and I can't get it working from hours.</p>
  
  <p>I'm working on an application for IOS 6 and IOS 7, just I need to move from my first viewController "A" which is on Landscape orientation, to a second viewController "B" which is on Portrait orientation.</p>
  
  <p>I configured the project to enable all desired orientation, set the "appropriate" code, but still get the second view displayed vertically on a landscape orientation..</p>
  
  <p><img src="https://i.stack.imgur.com/e7sz0.png" alt="enter image description here"></p>
  
  <p>here is the code I set for first controller :</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:      (UIInterfaceOrientation)interfaceOrientation
  {
  return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
  }
  
  -(BOOL)shouldAutorotate
  {
  return YES;
  }
  
  -(NSUInteger)supportedInterfaceOrientations {
  
  return UIInterfaceOrientationMaskLandscape ;
  }
  </code></pre>
  
  <p>Plz help.</p>