In Xcode 7 GM with Swift 2, I'm getting the error "Type of expression is ambiguous without more context" on the following line: var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)!
.
Can anyone help me out with fixing this? Thanks!
With swift 2 things change a little when loading a .sks file, you should create a fresh new SpriteKit project so that you can see how it works now, basically you do not have to extend SKNode
, and instead of using the method:
var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)!
You do something like:
if let scene = GameScene(fileNamed:"GameScene") { //your code here i.e. present your scene }
Hope that helps!