How to move between views in mac ? (change view)

Discussion in 'Mac Programming' started by sajjadzare, Mar 27, 2012.

  1. sajjadzare macrumors newbie

    Sep 1, 2010
    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];

Share This Page