Evening All,
I'm hoping this is a simple problem, as it doesn't "feel" like I'm pushing things too far here...
Having finally managed to get my hands on an iPad (I'm in the UK), I'm now trying to get the app I've been working for a while now to run on the device. It works to a certain degree, but is very prone to crashing on the device (fine in simulator)
What I have is a bunch of scenes, which I load in sequence (I suppose a book would be a good analogy). Each of these scenes has a bunch of child sprites, layers, etc. In some scenes, I have flipbook style animation sequences which activate under certain circumstances. For the animations, I'm making use of CCSpriteSheets. This all works fine.
My problem is that I can tap through the first few scenes, which are all fairly basic (light animation and static sprites mainly - with some audio), and I can flip back and forward between these scenes with no problem at all. But when I continue on to some of the more in depth scenes, I quite often (but not always) get a crash when I replace the scenes (status 10 or status 0).
It certainly doesn't seem to be a crash at a specific point in the code, as the scene replacement taking place can be different each time. If I reboot the device, it will let me get further through the scenes before it crashes, after which the crashing will occur far more quickly. So this all points to a memory / resources issue.
I've checked that all my scenes, sub-layers, etc, are being dealloc'd, I'm forcing a [[CCDirector sharedDirector] purgeCachedData] on applicationDidReceiveMemoryWarning (in my appDelegate). I'm also forcing a release of the sharedSpriteFrameCache in the dealloc of each scene (and verifying that it has ran through that bit of code).
Can anyone offer any hints and tips on what I should be doing to ensure memory is released between scene loads? Or offer any suggestions on things to try here? I'm out of ideas at the moment.
Oh, and the other thing is I've tried running this through the Leaks instrument, but it crashes the app at the point it tries to gather data after the first scene replacement.
Any advice would be gratefully appreciated!
Thanks,
D.