title: UIInterfaceOrientation always return Portrait in AppDelegate iPad?
body: <p>I want to show the Splash Screen in iPad application. Before that i want to get the current device orientation Landscape or Portrait mode. I have used,</p>
  
  <pre><code>    UIInterfaceOrientation orientation= [[UIApplication sharedApplication] statusBarOrientation];
      if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft)  
      {       
          splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
          splachview.image=[UIImage imageNamed:@"Default-Landscape.png"];
  
          splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
          splachview.contentMode = UIViewContentModeTop;
  
          [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
          [self.window addSubview:splachview];
      }
      else if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) 
      {
          splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)];
          splachview.image=[UIImage imageNamed:@"Default-Portrait.png"];
  
          splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
          splachview.contentMode = UIViewContentModeTop;
  
          [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
          [self.window addSubview:splachview];
      }
  </code></pre>
  
  <p>in <code>Appdelegate.m</code> . The UIInterface orienation always detecting in Portrait mode only. I launched the app in Landscape mode but, the control always detecting Portrait mode only. How can i get the current orientation in <code>AppDelegate.m</code>? Please help me to find the solution. Thanks in advance. </p>