【发布时间】:2016-02-02 05:16:24
【问题描述】:
这是在 Kinvey 中查询用户的示例代码,但是如果我不输入特定信息,则会出现错误。如何查询所有用户(在 Swift 中)?
//Find all the Smiths
KCSUserDiscovery.lookupUsersForFieldsAndValues(
[ KCSUserAttributeSurname : "Smith" ],
completionBlock: { (objectsOrNil: [AnyObject]!, errorOrNil: NSError!) -> Void in
if errorOrNil == nil {
//array of matching KCSUser objects
NSLog("Found %d Smiths", objectsOrNil.count)
} else {
NSLog("Got An error: %@", errorOrNil)
}
},
progressBlock: nil
)
【问题讨论】: