批量获取 Parse 和 Swift 2

Batch fetch Parse and Swift 2

使用 Swift 2 和 Parse 1.9.1,我似乎找不到 fetchAll() 函数。使用单个 PFObject,以下内容似乎在 objectPFObject 的情况下有效:

object.fetchInBackground()

然而,当尝试使用 fetchAllInBackground() 获取 PFObjects 的数组时,文档似乎允许,代码完成工具找不到任何此类方法。该函数是否更改了名称?如果是,我该如何使用它?请注意,我尝试使用该方法的方式如下,其中 listOfObjectsPFObjects:

的数组
listOfObjects.fetchAllInBackground()

如果你阅读 documentation 你会看到 fetchAllInBackground 和相关方法是 PFObject 上的 class 方法,它们不是数组的函数 class。

你可以称它为PFObject.fetchAllInBackground(listOfObjects)

fetchAlInBackground: 是一个 class 方法。

PFObject.fetchAllInBackground(listOfObjects)