title: Xcode help? - " 'didRotateFromInterfaceOrientation' undeclared " + " Expected ';' before ':' token "
body: <p>I am trying to create an application in Xcode that will switch to a new view when the phone is rotated from one orientation to another.</p>
  
  <p>Here is the "switchviewcontroller.h" file code:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SwitchViewController : UIViewController {
  
  }
  
  -(IBAction)switchview:(id)sender;
  
  @end
  </code></pre>
  
  <hr>
  
  <p>And here is the "switchviewcontroller.m" file code:</p>
  
  <hr>
  
  <pre><code>#import "SwitchViewController.h"
  #import "secondview.h"
  
  @implementation SwitchViewController
  
  -(IBAction)switchview:(id)sender
  
  // Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      // Return YES for supported orientations
      return YES;
  }
  
  - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
  {
      if((fromInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
         (fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight))
      {    
          [[secondview alloc] initWithNibName:@"secondview" bundle:[NSBundle mainBundle]];
      }
  
  }
  </code></pre>
  
  <p>I get the 2 errors showed in the question, so it doesn't work.</p>