当我尝试运行连接到默认GameScene.swift文件的 View Controller 之一时,出现以下错误。
致命错误:不支持NSCoder:
required init(coder aDecoder: NSCoder) {
fatalError("NSCoder not supported")
}
我打算使用SpriteKit,所以这就是为什么提示我使用必需的初始化程序的原因,但是我不确定为什么这会导致问题。
最佳答案
除非您已实现,否则不应该使用required init(coder aDecoder: NSCoder)
进行初始化(这是我不会讲的whole different topic)。尝试另一个初始化程序,例如-initWithNibName:bundle:
。
关于ios - 致命错误: NSCoder not supported' when using UIViewController,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32426480/