Changing viewController on Button Click

后端 未结 5 1976
不思量自难忘°
不思量自难忘° 2020-12-20 02:05

I am new to iPhone programming. what I am trying is I have one screen with a button. And I want to change the view controller not only the view when I click that button (I k

5条回答
  •  醉酒成梦
    2020-12-20 02:48

    Usually, you use a navigation controller for this sort of thing so that the user can easily go back to the previous view. Your view controller would then do something like this:

    [self.navigationController pushViewController:someNewViewController animated:YES];
    

    If you want to manage the view controllers yourself, you can always just change the window's rootViewController property. Please read View Controller Programming Guide for the complete picture.

提交回复
热议问题