问题
I have a sks file containing a scene (GameScene class), and I implemented initWithCoder: in GameScene. I'm trying to load the scene in the controller this way:
let file = NSBundle.mainBundle().pathForResource("GameScene", ofType: "sks")!
if let scene = NSKeyedUnarchiver.unarchiveObjectWithFile(file) as? GameScene
{...}
But the block is never executed and initWithCoder: is never called.
来源:https://stackoverflow.com/questions/35234887/failed-to-load-a-scene-from-an-sks-file