I am currently working on an app that utilizes this. In my mainViewController.h I have these 3 IBActions:
Code:
- (IBAction)loadSecondView:(id)sender;
- (IBAction)loadThirdView:(id)sender;
- (IBAction)loadFourthView:(id)sender;
So in my mainViewController.m is like so:
Code:
#import "mainViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "FourthViewController.h"
@implementation mainViewController
- (IBAction)loadSecondView:(id)sender {
SecondViewController *Second = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController: Second animated: YES];
}
- (IBAction)loadThirdView:(id)sender {
ThirdViewController *Third = [[ThirdViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController: Third animated: YES];
}
....// Same concept for Fourth view
Then you should be able to go into Interface Builder and create your mainViewController.xib with 3 buttons and connect each button to the correct function. And if you wanted to go back to the main menu you would use a function that calls [self dismissModalViewController: .... animated: YES] in each of your sub view controllers and link a button to the function that makes the call.