iDevGames Forums
Using ViewControllers - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Using ViewControllers (/thread-357.html)



Using ViewControllers - Jerm #1 - Feb 5, 2010 08:28 AM

My iPhone App is a child's game and I have about 20 different views that I want to randomly switch between. Now I have watched Nick Myers'
iPhone Tutorial - Multiple XIB files on Vimeo (iPhone Tutorial - Multiple XIB files on Vimeo), however, he is only switching between two views & nibs and does not release the first viewController. I have tried to set-up my app in this manner and get it to switch fine enough, but I must be doing something wrong still, because it isn't releasing the view controllers.

Could someone please explain why I need to have ViewControllers & Views for each XIB instead of just putting all the code in the ViewControllers and forgetting the views altogether? I have the code for switching the views in the AppDelegate file, is this a good way?

In my game, when each view shows up it asks you to touch a certain item on the screen.
HOW IS THE BEST WAY TO SET THINGS UP HERE?


Using ViewControllers - ThemsAllTook - Feb 5, 2010 08:35 AM

JermGuy Wrote:Could someone please explain why I need to have ViewControllers & Views for each XIB instead of just putting all the code in the ViewControllers and forgetting the views altogether? I have the code for switching the views in the AppDelegate file, is this a good way?

You don't. It's just convenient if you want to design your views in Interface Builder. If you eliminate xibs, your view controllers can become views.