0
我正在開發一款使用Cocos2D的遊戲。幾次成功玩遊戲後,突然出現了一些錯誤。而當我調試它給出的錯誤稱爲EXC_BAD_ACCESS。內存有問題嗎?
這裏是代碼。
-(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)]]];
}
難道你們能告訴我爲什麼嗎?
內存問題不在您粘貼的代碼中。考慮到你的評論,我假設方法調用[WinningScene節點]是問題,但很難說。 – 2009-11-30 04:33:45