Ios Swift编译错误:未解析的标识符
我正在游戏中使用SpriteKit和Swift。但是,当我想编译我的项目时,请获取未解析的标识符。但一切似乎都很好Ios Swift编译错误:未解析的标识符,ios,swift,Ios,Swift,我正在游戏中使用SpriteKit和Swift。但是,当我想编译我的项目时,请获取未解析的标识符。但一切似乎都很好 var sceneData = NSData.dataWithContentsOfFile(path!, options:DataReadingMappedIfSafe, error: nil) 问题: Swift Compile Error: Use of unresolved identifier: 'wDataReadingMappedIfSafe' 我怎样才能修
var sceneData = NSData.dataWithContentsOfFile(path!, options:DataReadingMappedIfSafe, error: nil)
问题:
Swift Compile Error: Use of unresolved identifier: 'wDataReadingMappedIfSafe'
我怎样才能修好它?我有什么问题?谢谢。有两个错误:
DataReadingMappedIfSafe应为。带前导点的DataReadingMappedIfSafe
用于枚举值。
NSData.dataWithContentsOfFile。。。在Swift中不再可用,您必须
使用NSDatacontentsOfFile:。。。
一起:
var sceneData = NSData(contentsOfFile: path!, options:.DataReadingMappedIfSafe, error: nil)