0
votes

I am new in spriteKit and am developing a game. I had some memory problem, which I solved, but after playing the game several times it now crashes due to 'bad access'.

At the end of each level I present an Image to indicate whether the user wins or loses, and remove all SKSpriteNodes in the SkScene:

[node removeFromParent];

and I do not use Preloading for textureAtlas.

This link is from my Xcode:

my Error Image 1

My Error Image 2

Crash Log:

Crash Log Description

i found the Error using test flight

3 UIKit 0x30ee700c _UIGestureRecognizerSendActions 4 UIKit 0x30d92502 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] 5 UIKit 0x31139af4 ___UIGestureRecognizerUpdate_block_invoke

1
@LearnCocos2D may be but can you tell me how to solve it ? i do not know anything about SKNodeShape and i do not use it - khaled
Try adding an exception breakpoint to pinpoint which line causes this error - ZeMoon
Also, a call stack should be logged when this error occurs. Please post that as well. - ZeMoon
@akashg i already post the stack when error occurs in the two images in the question my Error Image 1 My Error Image 2 - khaled

1 Answers

1
votes

I cannot understand your crash log, you can debug this while running your app itself at runtime.

A simple way to prevent EXC_BAD_ACCESS can be:

if (node != nil)
{
    [node removeFromParent];
}