tags:

views:

71

answers:

1

Hi everyone, I am developing game for iPhone using Cocos2d, the problem I am having now is the game crashes when it actually runs on the iPhone, but on the simulator is fine. Maybe the game has consume so much memory. Hmm I am thinking that maybe I create so many objects. Such as when the user play, if he makes mistakes, the game display a error subtitle on the screen, and the subtitles are different for each actions the player makes. I don't know the normal way developer use to create subtitles for game in Cocos2D. How do they switch the subtitle easily without consuming huge memory. I am trying the best way to reduce memory usage now. I switched Sprite to AtlasSprite, for timer and point counter I used LabelAtlas too. It still crashes, even though it uses less memory now.

Could anyone give me some good suggestions, like what standard people follow to create games in cocos.

+1  A: 

First, investigate what the real cause is... don't just guess.

Run a debug build on the device, attached to the debugger. See where the crash is happening in the stack trace.

If you determine it is memory related, then run with insturmentation: object allocation and leaks are the ones you want.

David Whatley