Hi
I’m porting example from chapter 04 from “Learn Cocos2d Game Development with iOS5” book (this one with spiders)
But on update method: spidersUpdate on line 113 (source in attachment) int randomSpiderIndex = (int)CCRANDOM_0_1() * spiders->count();
“Unhandled exception at 0x5506d279 (libcocos2d.dll) in DoodleDrop.win32.exe: 0xC0000005: Access violation reading location 0xfeeefeee.”
It looks like spiders CCArray object is empty. But WHY ??? It’s working fine with “player” object.
Any suggest?
method arrayWithCapacity automatically put the spiders to autorealease pool. It’s mean that he takes responsibility of release this object (and delete it at the end)
So as soon as possible he will release this object - that’s why we must inform the engine that we will need this spiders later. That’s why we call retain method.