title: IOS 6.0 + supportedInterfaceOrientations NOT applied when popping back to a controller with popViewControllerAnimated
body: <p>SOLVED:</p>
  
  <p>The only way to get around this problem (as far as I can tell) is to take your free rotating view controller outside of the hierarchy. One way to do this, is to temporarily assign your freely rotating controller to the app delegate rootcontroller. This way, when it rotates, the rest of your hierarchy will not be affected.</p>
  
  <hr>
  
  <p>I have a controller which I push and the supportedInterfaceOrientations is called properly and the value is returned properly - I am forcing portrait orientation.
  I have subclassed my navigator and tab controllers, so I am getting the relevant methods called fine. In fact everything works perfectly, except this one issue:</p>
  
  <p>From a particular controller, which supports only portrait, I push another one, which supports all orientations.</p>
  
  <p>While in this second controller, if I change the device to landscape, and then pop this controller while in landscape mode, the following occurs:</p>
  
  <p>In my original controller, supportedInterfaceOrientations is called fine (shouldAutorotate is returning YES) and the same orientation value as before (portrait only) is returned. However, even though I pass porrtait only, the content of the controller is still landscape.</p>
  
  <p>With break points, I have verified that supportedInterfaceOrientations is called every time. However, the returned value is not applied when a child controller landscape controller is popped.</p>
  
  <p>I have tried adding
  [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
  in viewWillAppear,
  but:
  1) It does not work and,
  2) Will this not get my app rejected?</p>
  
  <p>How can I solve this problem?</p>
  
  <p>EDIT, here is some code, although my problem is very basic.</p>
  
  <p>in controller 1, these are ALWAYS called:</p>
  
  <pre><code>-(BOOL)shouldAutorotate{
      return NO;
      ///return YES; // does not matter
  }
  
  
  -(NSUInteger)supportedInterfaceOrientations{
  
      return UIInterfaceOrientationMaskPortrait;
  
  }
  </code></pre>
  
  <p>then, at some point I push my second controller (it;s a video player):</p>
  
  <pre><code>[self presentModalViewController:playerController animated:YES];
  </code></pre>
  
  <p>in controller 2:</p>
  
  <pre><code>-(BOOL)shouldAutorotate{
      return YES;
  }
  
  
  -(NSUInteger)supportedInterfaceOrientations{
  
      return UIInterfaceOrientationMaskAll;
  
  }
  </code></pre>
  
  <p>step to repeat:</p>
  
  <p>1) launch app , it will show controller 1 in portrait mode as that's the mask returned. And it will not rotate.</p>
  
  <p>2) push (or even present modaly) controller 2.</p>
  
  <p>3) This one will rotate. Rotate to landscape mode.</p>
  
  <p>4) pop controller 2.</p>
  
  <p>5) controller 1 will be in landscape mode, even though,  shouldAutorotate and supportedInterfaceOrientations are called and they return the values as shown in code for controller 1.</p>