title: Switching from the Main View to a different View
body: <p>I am attempting to use a button to go from one View (XIB) to another View. I'm using Xcode 4.3.2 and iOS 5.  I start off by creating the project (Single View Application).  I then create my button in Interface Builder, create my outlet in the header file, and my IBAction in the .m file.  Next, I right clicked on my project folder in Xcode and selected "New File".  I then selected "Object-C Class" and named it "SecondViewController".  Two new files were created, "SecondViewController.h" and "SecondViewController.m".  Then I went back and right clicked on my project folder in Xcode, selected "New File" and chose "view" out of the "User Interface" options.  </p>
  
  <p>Now I have my empty IBAction (my button) which I want to use to go to a new view, which is called SecondViewController.xib.  </p>
  
  <p>If the creation of the new XIB and .h/.m files are correct up to this point, then how would I go about doing this using my button to "get to" or display my second view?  Keep in mind, I'm still at a beginner level and I appreciate any help and your patience :)</p>
  
  <p>The only differences I can tell between my main View and my SecondView are in the header files:</p>
  
  <p>Main View header file:</p>
  
  <pre><code>@interface ButtonToNewViewViewController : UIViewController
  </code></pre>
  
  <p>Second View header file:</p>
  
  <pre><code>@interface SecondViewController : NSObject
  </code></pre>
  
  <p>IBAction:</p>
  
  <pre><code>-(IBAction)nextView:(id)sender
  {
      // go to new view
  }
  </code></pre>