Failed to load a scene from an sks file

北慕城南 提交于 2019-12-24 14:28:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!