我有以下PFObject本地保存:解析錯誤代碼151
<Local: 0x6180000a4080, objectId: SAMPLEID, localId: (null)> {
ACL = "<PFACL: 0x60800002f0a0>";
image = "<PFFile: 0x60800005e7b0>";
name = Anonymous;
}
我試圖運行下面的代碼來獲取圖像:
let query = PFQuery(className: "Local")
query.fromLocalDatastore()
query.findObjectsInBackgroundWithBlock { (objects: [PFObject]?, error: NSError?) -> Void in
if let objects: [PFObject] = objects {
for object in objects {
let imageFile = object["image"] as! PFFile
imageFile.getDataInBackgroundWithBlock {
(imageData: NSData?, error: NSError?) -> Void in
if error == nil {
if let imageData = imageData {
let image = NSImage(data:imageData)
}
}
}
}
}
}
解析是給我下面的錯誤: 無法下載服務器上或本地不存在的文件。 (代碼:151,版本:1.11.0)