如何将PFFile转换为UIImage?
我已经成功从Parse获取了作为PFFile的图像。但是,由于它不是UIImage,所以我无法向用户显示视图。
有人可以指导我吗?
我一直收到以下错误:
error: [UIImageView setFile:]: unrecognized selector sent to instance 0x7ff2937a9bd0 on the console
每当我尝试从 Parse 中获取图像文件并将其设置为 UIImage 时,
以下是将文件设置为 UIImageView 的代码:
var initialThumbnail = UIImage(named: "AppIcon")
cell.customImage.image = initialThumbnail
if let picture = object?["image"] as? PFFile {
cell.customImage.file = picture
cell.customImage.loadInBackground()
}
这是自定义图像输出口的代码
@IBOutlet weak var customImage: PFImageView!
其他数据可以正常加载,唯一的问题在于文件数据。