I have the following PFObject saved locally:
<Local: 0x6180000a4080, objectId: SAMPLEID, localId: (null)> {
ACL = "<PFACL: 0x60800002f0a0>";
image = "<PFFile: 0x60800005e7b0>";
name = Anonymous;
}
I'm trying to run the following code to retrieve the image:
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 is giving me the following error: Can't download a file that doesn't exist on the server or locally. (Code: 151, Version: 1.11.0)