View Full Version : How to move between views in mac ? (change view)

Mar 27, 2012, 09:21 AM
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.

//button on view1
View2 *v2=[[View2 alloc]initWithNibName:@"View2" bundle:nil];
[self.view addSubview:v2.view];
//button on view2
[self.view removeFromSuperview];