transitioning between views

Discussion in 'iOS Programming' started by anuragsolanki, Dec 24, 2008.

  1. anuragsolanki macrumors newbie

    Dec 24, 2008
    I looked into a sample code provided by apple to switched between different views:
    This code shows to switch between views consisting of two images stored in the resource bundle.
    Can somebody please explain how can I use this code for switching between two or more views of our own specified ViewControllers.
  2. neil.b macrumors member


    Nov 20, 2008
    The trick is you can only define one UIView per UIViewController in a NIB file as you can only connect one UIView element to the "view" outlet in the "File's Onwer". Therefore you have to have another method than the example code you linked to.

    You need to set up your project so it has a "master" view controller which controls one or more "sub" view controllers. The "sub" view controllers control their own views.

                                        / \
                        ViewController01   ViewController02
                                   |                  |
                                View01            View02
    Have a look at the "Utility Application" template in Xcode. This shows you how to manage two UIViewControllers (and their UIViews).

Share This Page