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

JSDOS

macrumors newbie
Original poster
Nov 20, 2010
1
0
We have developed a game which seems to work flawlessly but crashes after 6 or 7 plays. I have thoroughly checked for leaks and do not think I have any but feel sure that crashes are memory related.

I get a Memory Warning Level 1, then I see my viewDidUnload is called (usually several times in a row) then the game plays a bit longer and then just dies.

When I run the program through leaks I do not see any leaks but do see all allocated objects rise steadily and I wonder if my architecture is wrong and I am just eating up all the memory.

The game stacks xibs via [self presentModalViewController:viewController animated:YES]; so you get a configuration screen, then a Map screen, then the game screen, when the game is over you get a score screen. From the score screen I call a method in the appDelegate that tells the first controller to

[self dismissModalViewControllerAnimated:YES];

which dismisses the chain of stacked modal views.

Does it really?

I see the viewDidLoad get called each time I start a new game but are the previous game screens really gone?
 

ianray

macrumors 6502
Jun 22, 2010
452
0
@
Did you use the "Leaks" instrument?

It is worth overloading the dealloc method, and setting a breakpoint (or inserting an NSLog) in order to understand when (and indeed whether) your classes are destructed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.