从Parse获取数据

时间:2015-09-08 13:05:08

标签: swift parse-platform

我使用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
        }
    }
}

0 个答案:

没有答案
相关问题