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

Hawkeye75

macrumors member
Original poster
Mar 29, 2010
32
0
Hi folks,

Quite simply I am creating a game with a Menu screen and 3 "boards" for different difficulties. The idea is that I wanted to add buttons on the Menu screen so that clicking the "Easy Game" would load the "Easy Board".

Now I know I can use a navigation controller and have a user select a difficulty then click some "Begin" button on a nav bar but that isn't the kind of look I was going for.

So I came across presentModalViewController and dismissModalViewController. After watching some tutorials these appear that they will do the trick.

What I want to know if there are any caveats I need to know about and whether or not it is advisable to use for a game? (puzzle)

I'm trying to be mindful of memory management and the like. When I look at apples documentation -

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW30

There doesn't seem to be any mention of what happens when the modal view is dismissed. I always nil any objects and release them in the dealloc method of my controller. Does dismissModaViewController call those methods to ensure proper cleanup or does it do it's own cleanup?

I'm sorry if I'm not 100% clear...I'm still trying to wrap my head around certain concepts. I'll be more than happy to clarify any discussion points.

Thanks
 
There's nothing special about memory management for a modal view controller vs other view controllers.

You can do this with a modal view controller or you can use a navigation controller with a hidden navbar. I recommend you use the hidden navbar.
 
There's nothing special about memory management for a modal view controller vs other view controllers.

You can do this with a modal view controller or you can use a navigation controller with a hidden navbar. I recommend you use the hidden navbar.

I've noticed apps many apps that seem to use hidden/transparent nav bars. However these buttons would still be limited to the top or bottom of the screen.
 
Hidden and transparent are completely different. Hidden means that you can't see it, at all.

If you use a hidden navbar then you must have your own controls to go 'Back' or forward. You use the navigation controller methods pushViewController: and popViewController in the usual way however to present and remove view controllers and their views from the screen. You can have whatever buttons you like wherever you like on screen to push or pop view controllers.
 
Hidden and transparent are completely different. Hidden means that you can't see it, at all.

If you use a hidden navbar then you must have your own controls to go 'Back' or forward. You use the navigation controller methods pushViewController: and popViewController in the usual way however to present and remove view controllers and their views from the screen. You can have whatever buttons you like wherever you like on screen to push or pop view controllers.

Ah I see, however pushing the view on the stack seems very similar to calling a modal view. Is it much easier to implement?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.