Sprite kit 自Swift 2.0以来的DataReadingMappedIfSafe错误

Sprite kit 自Swift 2.0以来的DataReadingMappedIfSafe错误,sprite-kit,swift2,viewcontroller,Sprite Kit,Swift2,Viewcontroller,由于Swift 2.0]在myGameViewController中执行这行代码时出现以下错误: var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)! 错误:“表达式类型不明确,没有更多上下文” 取代 NSDataReadingOptions.DataReadingMappedIfSafe 并删除最后一个参数: NSData(contentsOfFile: pa

由于Swift 2.0]在my
GameViewController
中执行这行代码时出现以下错误:

var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)!
错误:“表达式类型不明确,没有更多上下文”

取代

NSDataReadingOptions.DataReadingMappedIfSafe
并删除最后一个参数:

NSData(contentsOfFile: path, options: NSDataReadingOptions.DataReadingMappedIfSafe)

呼叫可以抛出和异常,将您的呼叫包含在

do {
 let data = try NSData(contentsOfFile: path, options:NSDataReadingOptions.DataReadingMappedIfSafe)
}catch {
     print("Error")
}

我已经试过了,但后来我收到另一个错误,告诉我:“调用可以抛出,但没有标记为“try”,并且错误未被处理”。