Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>MultipleViewsViewController.h should be:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @class FirstViewController; @class SecondViewController; @class ThirdViewController; @interface MultipleViewsViewController : UIViewController { IBOutlet FirstViewController *firstViewController; IBOutlet SecondViewController *secondViewController; IBOutlet ThirdViewController *thirdViewController; } //@property (nonatomic, retain) FirstViewController *firstViewController; //@property (nonatomic, retain) SecondViewController *secondViewController; //@property (nonatomic, retain) ThirdViewController *thirdViewController; -(IBAction)loadFirstView:(id)sender; -(IBAction)loadSecondView:(id)sender; -(IBAction)loadThirdView:(id)sender; @end </code></pre> <p>MultipleViewsViewController.m should be:</p> <pre><code>#import "MultipleViewsViewController.h" #import "FirstViewController.h" #import "SecondViewController.h" #import "ThirdViewController.h" @implementation MultipleViewsViewController //@synthesize firstViewController; //@synthesize secondViewController; //@synthesize thirdViewController; -(IBAction)loadFirstView:(id)sender{ [secondViewController.view removeFromSuperview]; [thirdViewController.view removeFromSuperview]; [self.view insertSubview:firstViewController.view atIndex:0]; } -(IBAction)loadSecondView:(id)sender{ [firstViewController.view removeFromSuperview]; [thirdViewController.view removeFromSuperview]; [self.view insertSubview:secondViewController.view atIndex:0]; } -(IBAction)loadThirdView:(id)sender{ [firstViewController.view removeFromSuperview]; [secondViewController.view removeFromSuperview]; [self.view insertSubview:thirdViewController.view atIndex:0]; } -(void)dealloc{ [firstViewController release]; [secondViewController release]; [thirdViewController release]; [super dealloc]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { firstViewController = [[FirstViewController alloc] init]; secondViewController = [[SecondViewController alloc] init]; thirdViewController = [[ThirdViewController alloc] init]; [self loadFirstView:nil]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } </code></pre> <p>Connect your buttons (which you haven't done in your project, which also might be the issue) and you're done.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload