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

sajjadzare

macrumors newbie
Original poster
Sep 1, 2010
9
0
magine that i put a button on a view(view1) and want to go to another view(view2) when user click on it and come back to first view when click on button that i put on view2. how can i do it?i use below code but when i want come back occur error.

Code:
//button on view1
View2 *v2=[[View2 alloc]initWithNibName:@"View2" bundle:nil];
[self.view addSubview:v2.view];
--------------------------------------
//button on view2
[self.view removeFromSuperview];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.