Serialized SKActions

I created a new Sprite Kit Action using New File..., which generted a file called MyAction.sks, but I'm not sure what to do with the file. I figured out how to use the editor to add actions to it from the Action list, but I'm not sure what good these are without any context, i.e., scene objects to act on. Is there a tutorial somewhere or an explanation about how to use these?

Just figured out that I can load and run the named actions in the file using


if let action = SKAction(named: "SomeAction") {
     scene.runAction(action)
}


So I guess this would be useful for preparing sound effects, etc.

I've been working through the DemoBots example and having a lot of trouble getting it to work.


https://developer.apple.com/library/prerelease/ios/samplecode/DemoBots/Introduction/Intro.html


The current problem I'm having is that on an iPad Mini the app launches but crashes when loading animations. It crashes in AnimationComponent.swift on the line that loads an action from a file:


        let bodyAction: SKAction?
        if let name = bodyActionName {
            bodyAction = SKAction(named: name)
        }
        else {
            bodyAction = nil
        }


Debugging the app reveals that its trying to load an SKAction called "ZappedShake" but crashing with an array out of bounds exception.


On an iPhone 5S it runs fine. I think what is going on is that somehow the iPhone 5S is loading the file with the action serialized in it, and by the time execution reaches this point the action is available. But on the single core older iPad the file is not yet loaded and the call fails.


All I know is that the exact same project with no changes crashes on one device and not on the other. Both are real hardware running iOS9 13A4325c, compiled on XCode Version 7.0 beta 4 (7A165t). The previous para is guesswork.


What is mystifying me is I can't see where the file that apparently creates the "ZappedShake" - ReferenceActions.sks - is actually loaded. Its referred to by ReferenceScene.sks but nowhere in any of the code or anywhere else in the project can I see that file being referred to.


Is there some sort of magical file loading mechanism for SKActions?


UPDATE:


I found some more on the magical loading of SKActions:

http://asciiwwdc.com/2015/sessions/604


"We're allowing you to create serialized data files for your nodes and your actions and then add them as a reference instead of just loading them into your scene.

This way, every time you make a change to the source asset that is automatically reflected in the content of your game.

How do I do this for nodes?

For nodes I design part of my scene, maybe a background element, or some scenery in our editor with an Xcode and then I can just drag-and-drop those files into my main scene in Xcode and it will automatically create a reference and it is all set up for you.

If you want to do this in code you can as well, you can manually construct an SKReferenceNode, assign it a file name or even a URL and when that content is first presented in your game we'll load in that content based on the latest version of the file that's in your bundle.

We can also do the same thing for actions.

With actions go check out our great new action editor and beyond creating and composing the actions in Xcode you can give all them names.

These names are the key to using them in your game.

We have added a selector to SKAction called actionNamed.

This works just like it does for SKTexture and textureNamed.

You pass in the name of the action you want.

We're going to automatically look inside of your app bundle in all of the serialized action files, find the one with the appropriate name and then surface that to the application."


Still don't understand exactly why this is working on one device and not on another.

Serialized SKActions
 
 
Q