problem with multiple views

Discussion in 'iOS Programming' started by wbm234, Oct 5, 2009.

  1. wbm234 macrumors newbie

    Joined:
    Oct 5, 2009
    #1
    I am making a basic game. When you open the app you go to a menu screen, you click "single play" and you slide over to a pre-game screen (so you can select time limit, and other options), and then you click "play" to slide over to the game.

    I am structuring this by having a root view controller, RootViewController, that has 2 other controllers as instance variables, PreGameViewController (which has the options mentioned above) and GameViewController (which holds all the game logic). When you click the "single play" button on the main screen I can easily swap out the RootViewController's view for the PreGameViewController. However, the "play" button inside the PreGameViewController cannot tell the RootViewController to swap its view out for the GameViewController view can it? Somehow I need to it to tell GameViewController what settings the user chose, and then switch over to its view.

    I am very new to this, so I have probably structured everything incorrectly. Any help is much appreciated...
     
  2. Rappa819 macrumors newbie

    Joined:
    Feb 28, 2008
    #2
    Theres a lot of tutorial around for connecting setting screens to applications. As for your problem, it's hard to help without the code you're trying to fix.
     
  3. wbm234 thread starter macrumors newbie

    Joined:
    Oct 5, 2009
    #3
    Sorry, I can provide more info, but since this has probably been covered ad nauseum, could you point me to those tutorials? I tried a naive search from your suggestion and didn't really find anything. Thanks...
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    You should use a navigation controller for this. Your terminology 'you slide over to' is exactly what the navigation controller provides. If you don't want to see the navbar you can make it hidden.

    Using the nav controller will make all of this much simpler for you.
     

Share This Page