tags:

views:

61

answers:

1

Hi there

I am developing a game using Cocos2D. I got some error out of sudden after few time successfully played the game. And When i debugged it gives the error called EXC_BAD_ACCESS.

here is the code.

    -(void) winGame
        {
//the debug stopped here...
            WinningScene *winner = [WinningScene node];
            [[Director sharedDirector] replaceScene:[FadeTransition transitionWithDuration:1.0 scene:winner]];
        }
    if ((touchCount > 0 && touchCount ==2) && (rangeY2 > 0.0 && rangeY2 < 20.0))
        {
         bras++;
         if (bras == 1)
         {
          //[self winGame];
          [self runAction:[Sequence 
               actionOne:[DelayTime actionWithDuration:0.5]
               two: [CallFunc actionWithTarget:self selector:@selector(winGame)]]];

         }

Could u guys tell me why ?

+1  A: 

Unfortunately, it's a bit difficult to debug EXC_BAD_ACCESS errors. They usually indicate either accessing array out-of-bound, or dereferencing a released object. Go over you code, and check that you retain any reference you assign to field and that you set such fields to nil whenever you release them.

notnoop