Hi all,
Apologies for the long post and I hope it makes some sense to someone out there.
I have written an iPhone game (in Quartz 2d) which uses the following structure :
- App delegate loads a view controller called gameviewcontroller and its associated view
- In the "View did load" method, the gameviewcontroller starts up and initiates a Game Controller class (NSObject). It also starts a timer on a "Game Loop" method in the Game Controller. Finally it tells the Game Controller to use the same view as the gameview controller (which is a custom UIView).
This all works fine. I am now trying to integrate a Main Menu for the game. So far I have done the following :
- Created a new View Controller called "Main Menu" with an associated NIB. In the NIB I have created my main menu with a "Start" button.
- Altered the app delegate to load the Main Manu NIB and display its view.
- Set a method so that when the button is pressed it then loads the gameviewcontroller (which effectively starts the game).
So far so good - pressing the "start" button starts the game. But.....
The problem is now that I can't find a way for the Game Controller to call up the Main Menu class (e.g for when game is over). I can't use "self dismissModalViewController" as Game Controller is an NSObject class and not a view controller. How can I get the Game Controller to pull up my Main Menu ?
Thanks all for reading,
Martin