If you are not using a navigation controller and you do not need to switch to another view controller, then something like this will simply switch the views:
[ myCurrentTopView removeFromSuperView ]
[ window addSubView: myNewView ]
To do this, you will need a link to the current top view (myCurrentTopView in the above example) and may want to make sure your myNewView object is selected, initialized, the correct frame size, etc. in advance.
source
share