2015-09-06 13 views
2

當我嘗試運行其中一個連接到默認GameScene.swift文件的視圖控制器時,出現以下錯誤。使用UIViewController時'致命錯誤:NSCoder不支持'

致命錯誤:NSCoder不支持:

required init(coder aDecoder: NSCoder) { 
    fatalError("NSCoder not supported") 
} 

我打算使用SpriteKit,所以這就是爲什麼我被提示使用所需的初始化,但我不知道爲什麼,這是造成問題。

回答

1

你不應該使用required init(coder aDecoder: NSCoder)進行初始化,除非你已經實現它(這是我不會離題的whole different topic)。嘗試另一個初始化程序,如-initWithNibName:bundle:

相關問題