Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wbm234

macrumors newbie
Original poster
Oct 5, 2009
2
0
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...
 
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.
 
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...
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.