views:

91

answers:

2

Hi.

I'm programming an puzzle game for iPhone using openGL.

There Is one very weird "bug" ( I'm not sure what It is)... whenever I touch the screen a great number of times in a short period of time my app closes, without giving a warning or error.

What could be the cause ?, I guess It has something to do with the memory, but I would like to know.

Edit: I also think this happens because I'm calling multiple functions every time the user touches the screen or moves his fingers.

+2  A: 

Sounds like you're running out of memory.

A few quick tips that might help out:

  • Check your memory profile over time using Instruments. If you see a steady incline over time, it's likely to be a memory leak, or an inefficient algorithm that is allocating more memory than you need.
  • Use a static analyzer to help check for leaks, such as Clang.
  • Images and image-related files are particularly memory-hungry, so focus on efficiency for them. When you work with textures in OpenGL, use the PVRTC format, which offers awesome compression.
  • didReceiveMemoryWarning: is your friend - aka a good chance to throw out anything you don't absolutely need in memory. Better to be memory-efficient the whole time, though.
Tyler
A: 

Try setting up an NSUncaughtExceptionHandler. You may also want to setup a signal handler.

drewh