在Swift中加载PFImageView的问题

时间:2016-10-10 15:44:08

标签: ios swift parse-platform lazy-loading

我有一个PFQueryTableView的PFImageViews。我正在尝试按照本教程懒洋洋地加载图像:http://blog.parse.com/learn/engineering/loading-remote-images-in-a-table-view/

这是cellForRowAtIndexPath

中的旧代码
let imageWillUse = object!["Image"] as! PFFile
    var imageToLoad = UIImage()
    do {
        try imageToLoad = UIImage(data:imageWillUse.getData())!

    } catch {

        print(error)
    }
    cell.postImageView.file = imageToLoad

现在,按照教程,我改为使用此代码

let image: PFFile = object!["Image"] as! PFFile
cell.postImageView.file = image //error on this line

当我尝试运行时,Xcode会报告[UIImageView setFile:]: unrecognized selector sent to instance。我需要改变什么?

0 个答案:

没有答案