Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonejudy

macrumors 6502
Original poster
Sep 12, 2008
301
1
Hi,

I use the below code to display a view when button click.but the view is not display.Can anybody please tell me the reason.

//
// TestViewController.m
// TestApplicationTwo


#import "TestViewController.h"
#import "Test2ViewController.h"


@implementation TestViewController
@synthesize view2Controller;

-(IBAction)display:(id)sender
{




//Load the view controller from the HelloView nib file.
Test2ViewController *vController = [[Test2ViewController alloc]
initWithNibName:mad:"Test2View" bundle:[NSBundle mainBundle]];

//set the view.
self.view2Controller = vController;

//release the view controller.
[vController release];


}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Initialization code
}
return self;
}





// If you need to do additional setup after loading the view, override viewDidLoad.
- (void)viewDidLoad {



Test2ViewController *view2 = [[Test2ViewController alloc] initWithNibName:mad:"Test2View" bundle:[NSBundle mainBundle]];
self.view2Controller = view2;
[view2 release];

}



- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}


- (void)dealloc {
[super dealloc];
}


@end

Thanks
judy
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.