title: iPad Rotation, Any Way To Load Custom View Based On Orientation?
body: <p>Im writing an app that I would like to display different views based on orientation. For example, if the device is portrait load pView, if landscape load lView. Below is the code ive currently tried.</p>
  
  <pre><code>- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)
  interfaceOrientation duration:(NSTimeInterval)duration {
   if (interfaceOrientation == UIInterfaceOrientationPortrait)
  {
        self.view = portrait;
  }
   else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        self.view = portrait;
   }
   else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight){
        self.view = portrait;
   }
   else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
        self.view = landscape;
   }
  </code></pre>
  
  <p>}</p>
  
  <p>With this I have created 2 views in IB and connected the outlets to the right view. Ive also tried this:</p>
  
  <pre><code>- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)
  interfaceOrientation duration:(NSTimeInterval)duration {
   if (interfaceOrientation == UIInterfaceOrientationPortrait)
  {
        self.view = portrait;
  }
   else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        self.view = portrait;
   }
   else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight){
        lView *abo = [[lView alloc] initWithNibName:@"lView" bundle:nil];
        [self.navigationController pushViewController:abo animated:NO];
        [abo release];
  
   }
   else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
        lView *abo = [[lView alloc] initWithNibName:@"lView" bundle:nil];
        [self.navigationController pushViewController:abo animated:NO];
        [abo release];
  
   }
  </code></pre>
  
  <p>}</p>
  
  <p>The code directly above worked for ipod but not ipad. Any ideas?</p>