/ Published in: Objective C

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#import "VCExampleViewController.h" //---import the header file for the view controller--- #import "SecondViewController.h" @implementation VCExampleViewController SecondViewController *secondViewController; //---add the view of the second view controller to the current view--- -(IBAction) displayView:(id) sender{ secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondView" bundle:nil]; [self.view addSubview:secondViewController.view]; } - (void)dealloc { //---release the memory used by the view controller--- [secondViewController release]; [super dealloc]; } @end
Comments
