hey i have this code that keep giving me
thread 1 exc_bad_access (code=1 address exception
first i have this
in the class MAPlayfieldLayer : public CCLayer constructer
MAPlayfieldLayer::MAPlayfieldLayer() { gemsInPlay = CCArray::create(); this->scheduleUpdate(); }
and the update method i have :
void MAPlayfieldLayer::update(float dt) { gemsMoving = false; if(gemsInPlay!=NULL) { //See if we have any gems currently moving CCObject *aGemIt; CCARRAY_FOREACH(gemsInPlay,aGemIt) { MAGem *aGem = static_cast<MAGem*>(aGemIt); if (aGem->getGemState() == kGemMoving) { gemsMoving = true; break; } } } }
i allways getting exception on CCARRAY_FOREACH(gemsInPlay,aGemIt)
that say :exc_bad_access (code=1 address in xcode