title: supportedInterfaceOrientations not called with iOS 7
body: <p>I searched for an answer to this, but couldn't find anything which solved my problem.</p>
  
  <p>So here's the problem:
  I have a custom UINavigationController, when creating it the <code>supportedInterfaceOrientations</code> method is called on the rootViewController(only supports portrait).
  But when pushing an other ViewController onto the stack this method isn't called on the pushed ViewController(supports all but upside-down).</p>
  
  <p>I solved it by calling <code>[self supportedInterfaceOrientations]</code> in the <code>viewDidLoad</code>-method, but i think that's not a good way to solve the problem.</p>
  
  <p>I hope you can help me in that matter.</p>
  
  <p>Here's my code i implemented in the second viewController.</p>
  
  <pre><code>- (BOOL)shouldAutorotate {
      return YES;
  }
  
  - (NSUInteger)supportedInterfaceOrientations {
      if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
          [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAllButUpsideDown];
          return UIInterfaceOrientationMaskAllButUpsideDown;
      }
      else {
          [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAll];
          return UIInterfaceOrientationMaskAll;
      }
  }
  </code></pre>
  
  <p>I think the solution from johnMa should work fine for the most apps, but in my case, there's a special problem i think, but i solved it by myself now(not sure if it's a good one, but it works).</p>
  
  <p>I implemented the <code>- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated</code> method on my navigationController-delegate.</p>
  
  <pre><code>- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
  {
      if (DEF_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7")) {
          if ([viewController respondsToSelector:@selector(supportedInterfaceOrientations)]) {
              [viewController supportedInterfaceOrientations];
          }
      }
  }
  </code></pre>
  
  <p>I hope this can help others with the same problem.</p>