我在本地保存了以下 PFObject:
<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)
}
}
}
}
}
}
Parse 给我以下错误:无法下载服务器或本地不存在的文件。(代码:151,版本:1.11.0)