views:

813

answers:

1

I have placed two button in navigation controller on click of each button it should open new view , how to load a new view on click of a button

A: 

Right-click the Classes group in the project window of Xcode and select Add->New File… Select the UIViewController subclass template from the Cocoa Touch Classes and click Next. Name the view FirstViewController (make sure that the Also Created flag is selected) and click Finish. You get two files (FirstViewController.h and FirstViewController.m). Right-click again the Classes group and choose Add -> New File… This time, select View XIB template from the User Interface under iPhone. Click Next and name the file FirstViewController.xib. Click Finish. Repeat the last paragraph for the second and third view (name them SeconViewController and ThirdViewController).

Right-click the Classes group in the project window of Xcode and select Add->New File… Select the UIViewController subclass template from the Cocoa Touch Classes and click Next. Name the view FirstViewController (make sure that the Also Created flag is selected) and click Finish. You get two files (FirstViewController.h and FirstViewController.m). Right-click again the Classes group and choose Add -> New File… This time, select View XIB template from the User Interface under iPhone. Click Next and name the file FirstViewController.xib. Click Finish. Repeat the last paragraph for the second and third view (name them SeconViewController and ThirdViewController).

Pinky