Showing posts with label Switch Views using Multiple Viewcontrollers. Show all posts
Showing posts with label Switch Views using Multiple Viewcontrollers. Show all posts

Tuesday, April 19, 2011

How To Switch Views using Multiple Viewcontrollers

1) Open up XCode > New Project > View Based Application

2) Call it SwitchViews and hit Save If you look under your resources folder, you can see Xcode already gives you new NIB (.xib) files, and already interconnects them New Project

3) Now we need to add another NIB file, but first lets add the class files first. Click File > New File UIViewController subclass. Call it NextView.m and hit Save. (check the box that says create .h too)

Add Subclass

4) It will be added under your classes folder. Now, under your Classes folder, click on SwitchViewsViewController.h to open up the header file.

5. Type this -(IBAction)next:(id)sender;

6) Double click on SwitchViewsViewController.xib