title: Auto Rotation iOS 8 Navigation Controller
body: <p>I have certain <code>viewControllers</code> which are managed by a <code>UINavigationController</code> (push and pop). I want to restrict different <code>viewControllers</code> to different <code>orientations</code> like the first one should be only in <code>Portrait</code>, second in <code>portrait</code>, third in <code>landscape</code> and fourth can be <code>portrait</code> and <code>landscape</code> both. I set a <code>ViewController</code> on <code>isInitialViewController</code> from <code>storyBoard</code>, the </p>
  
  <pre><code>- (BOOL) shouldAutorotate{
  return NO;
  </code></pre>
  
  <p>}</p>
  
  <p>worked without any problem but when i set the <code>navigation controller</code> (managing these four views by push and pop) as <code>isInitialViewController</code> from <code>storyBoard</code>, this function stopped being called and now <code>autoratates</code>. How can I stop <code>autorotating</code> these views using this <code>UINavigationController</code> as the <code>isInitialViewController</code>. I use the following functions depends on which <code>ViewController</code> it is</p>
  
  <pre><code>- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
  return (interfaceOrientation == UIDeviceOrientationPortrait);//choose portrait or landscape}
  
  - (BOOL) shouldAutorotate{
  return NO;
  }
  
  - (NSUInteger)supportedInterfaceOrientations
  {
  //return UIInterfaceOrientationMaskLandscape;
  return UIInterfaceOrientationMaskPortrait;
  }
  
  - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
  { 
  //    return UIInterfaceOrientationLandscapeLeft |
  //    UIInterfaceOrientationLandscapeRight;
  return UIInterfaceOrientationPortrait;
  }
  </code></pre>