![]() |
|
Using Multiple Views - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Game Programming Fundamentals (/forum-7.html) +--- Thread: Using Multiple Views (/thread-361.html) |
Using Multiple Views - Jerm #1 - Feb 3, 2010 10:58 PM 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 (http://www.vimeo.com/1450817), 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? Also, I have multiple sounds for each view...where is the best place to put the code for my sounds? Here is where I have the sounds right now: (in the viewController.m file) Code: - (void)viewDidLoad {HOW IS THE BEST WAY TO SET THINGS UP HERE? Using Multiple Views - maximile - Feb 4, 2010 05:26 AM Generally you don't release view controllers. You often don't need to release the views either; by default the controller will respond to low memory warnings by releasing the view, then recreating it when it's called for. This is nice because it keeps navigation smooth where possible. There are lots of reasons you might want to override this, but the default behaviour is often good enough. |