我使用parse作为后端服务,我有一个Class,在该类中有两个PFFile
s。问题是我在尝试从课程中下载文件时遇到错误,同时我使用查询。
var query:PFQuery=PFQuery(className: "Data");
query.findObjectsInBackgroundWithBlock {
(objects: [AnyObject]!, error: NSError!) -> Void in
if !(error != nil) {
imageFiles1[indexPath.row].getDataInBackgroundWithBlock { (data1, error) -> Void in
if let downloadedImage1 = UIImage(data: data!) {
cell.postedimage.image = downloadedImage1
}
}
imageFiles2[indexPath.row].getDataInBackgroundWithBlock { (data2, error) -> Void in
if let downloadedImage2 = UIImage(data: data!) {
cell.postedimage.image = downloadedImage2
}
}
}