0

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

khaled
  • 865
  • 9
  • 24

1 Answers1

1

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];
}
ZeMoon
  • 20,054
  • 5
  • 57
  • 98
  • 1
    i think send Message to nil object does not crash the app – khaled Apr 22 '14 at 12:23
  • You still have not been able to point out where exactly you get this crash – ZeMoon Apr 22 '14 at 13:28
  • can you check Crash log description Link in the Question – khaled Apr 22 '14 at 13:53
  • "I think" is not valid, unless you have actually tried it out. The Crash Log link is not Symbolicated. Check this: http://kevincupp.com/2011/05/12/symbolicating-ios-crash-logs.html – ZeMoon Apr 22 '14 at 13:56
  • EXC_BAD_ACCESS usually means that you are sending a message to an object that no longer exists. – ZeMoon Apr 22 '14 at 13:59
  • i get .ips file in the crash report folder not .crash file do you have any idea about how to symobolicate it and also i have .ipa file and .dsym file – khaled Apr 23 '14 at 16:34
  • @akashg I know that sending messages to nil will not cause a crash. By the objective -c specification it is a perfectly valid thing to do. Sending it to nil is very different than sending it to an object that no longer exists. – David Berry Apr 26 '14 at 16:51