0

I am working on sprite kit and now I have a group of SKActions where many nodes perform different actions together. It is after every time the app becomes active from inactive state.

Also I have a double tap gesture recognizer to remove the node from parent and its data. Every time I make the app becomes active, and then tried to remove a node with my gesture, it will give me a NSRangeException.

I don't have any possible errors in my loop. I believe it is because of the group of skactions being performed together because after I comment that line, everything goes fine when I delete nodes.

So what is wrong with it? (I tried to remove actions before deleting but still wrong).

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
zh_Vincent
  • 17
  • 4
  • 1
    post your code, exact error message, and highlight the line where error occurs – CodeSmile Jan 29 '15 at 00:03
  • Its hard to post my code, it is part of my entire program. I can say that the line "[self runAction: [SKAction group: myActionArray] ];" that makes the NSRangeException. – zh_Vincent Jan 29 '15 at 06:13
  • of course it's part of your program, but you can just post the function where it crashes plus any other code related to that, ie if you init the array elsewhere post that too. Sounds like the array is either nil or empty, check if that is the case. – CodeSmile Jan 29 '15 at 09:33
  • I think all other is right, including the array. The array works fine and SKActions do perform well so I can see the animation. But just after I double click (delete) the node, it will crash and give me the NSRangeException. But in my code of deleting, there are no any for loops. Is there any other possibility? – zh_Vincent Jan 29 '15 at 10:00

0 Answers0