title: How to detect the orientation changing ipad
body: <p>Im creating an iPad application that should be supported both landscape and portrait. I have set root view controller in <code>AppDelegate</code> like this. This view is my Splash screen view.</p>
  
  <p>Inside</p>
  
  <p>`</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
  
    if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft)
  {
      //Do what you want in Landscape Left
      viewController1=[[SplashLandscapeViewController alloc] initWithNibName:@"SplashLandscapeViewController" bundle:nil];
  }
  else if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight)
  {
      //Do what you want in Landscape Right
      viewController1=[[SplashLandscapeViewController alloc] initWithNibName:@"SplashLandscapeViewController" bundle:nil];
  }
  else if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait)
  {
      //Do what you want in Portrait
      viewController1=[[SplashLandscapeViewController alloc] initWithNibName:@"SplashViewController" bundle:nil];
  }
  else if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)
  {
      //Do what you want in Portrait Upside Down
      viewController1=[[SplashLandscapeViewController alloc] initWithNibName:@"SplashViewController" bundle:nil];
  }
  
  
  
  
  
  self.window.rootViewController = viewController1;
  [self.window makeKeyAndVisible];
  
  return YES;
  </code></pre>
  
  <p>}</p>
  
  <p>And this is working fine. And this viewcontroller1 is dissmiss after 4,5 seconds and load another viewcontroller. My problem is while that viewcontroller1 showing on the screen, if user turn the ipad how can I recogniz it and load my landscape .xib after removing the current portrait xib.</p>
  
  <p>Please help me.
  Thank you</p>