SpriteKit XCode 7 GM - iOS9 GM [SKAction actionNamed] causes crash

Made a custom action in sks editor. Named it and tried to run it programitically. Crashes with the following error:


*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (2032684848 (or possibly larger)) beyond bounds (264)'


Which is very odd... Here is the code:


SKSpriteNode *testSprite = [self childNodeWithName:@"testSprite"];
[testSprite runAction:[SKAction actionNamed:@"testAction"]];


Anyone have a work around? This is pretty detrimental to our development.

Replies

Hmm, try SKNode instead SKSpriteNode .

It works by me in Swift and Objective C.

What devices are you testing on? We're getting a similar crash, but it only happens with iPhone 5 and earlier.

Hi Dillonion,


Thanks for reaching out. Would you be able to pack your project up in radar for us to look at, posting the radar number back here?


Could you verify for me that [SKAction actionNamed:@"testAction"] is returning a valid instance and not nil?


The action file is human readable and can be browsed quickly if you use the 'plutil -p <filename> | more' commandline command.


Cheers

Forgot about this as I moved onto another project for a while.


This is still an issue with my project in XCode 7.1, however Ahrihliir is correct that it behaves normally on newer devices (I tested on iphone 6). I am getting the crash running on an iPad3, my test project I attached to the radar below crashes in the simulator running on iPad2. Behaves correctly on iPhone 6.


I filed this bug a while back but they said they couldn't reproduce the problem

22649667


Ran some more tests.


Crashes:


iPad 3, iPad 2, iPhone 4s, iPhone 5


Behaves Correctly:


iPhone 5s

iPhone 6

iPhone 6+



Trend here seems to be 32 vs 64 bit devices.

Hi Dillonion,


Thank you for your patience. This issue has been fixed in iOS 9.2 Beta 1, which is now available via the Developer Center. If any issues persist, please update the original bug (22649667) with a description.


Thanks.

Tcasella, will you be opening up a 9.2 forum now its released so we can discuss any issues etc ? I know I am seeing some major issues since installing it this morning but other than bug report don't currently have a forum (nothing under the pre-release category) to discuss with other devs. Thanks

Hi Wildcat_1,


I'm not aware of a 9.2 forum being created, but I will look into it and reply again if one will be created. If any serious issues are encountered, please do not hesitate to file a bug report. They're the best way for us to keep track of these issues.


Thanks.

I have the same crash on my project for tvOS/iOS.

It seems that this crashes on 32-bit devices.


" [planeSpriteComponent.sprite runAction:[SKAction repeatActionForever:[SKAction actionNamed:@"MoveSmallPlane"]]];"


"[3200:1655596] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (939739400) beyond bounds (44)'"

Hi rurza,


Please try out iOS 9.2 Beta 2, which is now available via the Developer Center. If any issues persist, please let us know.


Thank you.

Is there a Workaround for this issue?

Or should we only support iOS 9.2 in the first release

Updated to iOS 9.2 and if fixed the problem on the iPhone 5. Objective C program, but I was testing out a named method from the actions editor. Worked on newer iPad Air, but not iPhone 5 until this update.


Should I worry about existing older hardware customers?