在重新发布xcode更新后,我在构建项目时遇到了这个奇怪的错误。任何帮助将不胜感激。
谢谢和问候 桑杰。
if let dataFromFilePathString = NSData(contentsOfFile: DataJsonFilePath) {
var dictionary:[String:Any]? = [:]
let data = (data: dataFromFilePathString as Data) // ERROR
答案 0 :(得分:-1)
通过@Martin R的提示,我可以将代码更正为。
let url = NSURL(string: DataJsonFilePath)
let dataFromFilePathString = NSData(contentsOf: url! as URL) as Data?
var dictionary:[String:Any]? = [:]
if let data = dataFromFilePathString {
Thankx ..