简体   繁体   English

在单个查询中解析加载多个PFFile图像

[英]Parse load multiple PFFile images in single query

Here is how I load images: 这是我加载图像的方式:

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.")
        }
    }
}

I run this piece of code for every single image the user loads. 我为用户加载的每个图像运行这段代码。 Is there a way to load multiple images with only 1 query? 有没有一种方法可以只通过一个查询加载多个图像?

No, in Parse you can not do such a thing. 不,在Parse中您不能做这样的事情。

What you can do is 你能做的是

  1. Follow parse blog and see if they introduce such a thing in the future. 关注解析博客 ,看看他们将来是否会介绍这种事情。
  2. Parse has recently open-sourced its SDKs and if you wish to spend the time, you can commit such a code and hope that they accept it. Parse最近开放了其SDK 的源代码 ,如果您希望花费时间,可以提交这样的代码并希望他们接受。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM