这是我加载图片的方式:
func LoadImage(sender:FeedVC, cellId:Int){
self.currentlyLoading = true
let query = feed[cellId].fileName
query.getDataInBackgroundWithBlock {
(imageData: NSData!, error: NSError!) -> Void in
if error == nil {
self.feed[cellId].fileImage = UIImage(data:imageData)!
self.feed[cellId].loading = 2
self.loadedCount++
self.currentlyLoading = false
sender.updateCell(cellId, animation: true)
self.CheckWhatToLoad(sender)
} else {
println("The LoadImage request failed.")
}
}
}
我为用户加载的每个图像运行这段代码。有没有办法只用一个查询加载多个图像?
最佳答案
不,在 Parse 中你不能做这样的事情。
你能做的是
- 关注parse blog看看他们有没有介绍这样的东西 future 。
- Parse 最近 open-sourced它的 SDK,如果你想花 时间,你可以提交这样的代码,希望他们接受。
关于ios - 解析在单个查询中加载多个 PFFile 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27661844/