title: Forcefully load landscape view when user in Portrait view
body: <p>In my Application I'm using a navigation controller to mange views. My login page support both portrait and landscape views. When user logged in my second view is home and it support only landscape mode. What I want to do is when user login to the home using portrait view home page should appear in landscape view even though the device in portrait.</p>
  
  <p>So what I did was I change the status bar orientation in to landscape int the home page's <code>viewWillAppear</code> method as follows;</p>
  
  <pre><code>    -(void)viewWillAppear:(BOOL)animated{
  
          [super viewWillAppear:animated];
          [[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeRight animated:NO];
  UIDeviceOrientation orien = [[UIDevice currentDevice] orientation];
      }
  </code></pre>
  
  <p>also I have override the <code>shouldAutorotateToInterfaceOrientation</code> as follows</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
  
  return YES;
  
  }
  </code></pre>
  
  <p>My problem is even the status bar changed to landscape my <code>UIViewController</code> (home) is remains in landscape mode. When i'm debugging  I found that even I change the status bar orientation to landscape,<code>[[UIDevice currentDevice] orientation]</code> returns portrait.  I went through internet whole day. And implement lot of solutions proviede by other but my whole day wasted. can some one guide me to solve these issue.</p>