这是我从PFUser中提取的内容:
let currentUser = PFUser.currentUser()
currentUser!.refreshInBackgroundWithBlock { (object, error) -> Void in
print("Refreshed")
currentUser!.fetchIfNeededInBackgroundWithBlock { (result, error) -> Void in
let userSchool = currentUser!.objectForKey("school") as! String
然后我想在参与者查询中使用“userSchool”。
var query = PFQuery(className:"Participant")
query.whereKey("school", equalTo:userSchool)
query.findObjectsInBackgroundWithBlock {
(objects: [PFObject]?, error: NSError?) -> Void in
}
如何获得equalTo
:表示“userschool”,以便我可以提取数据?
这一切都在同一张桌子上,BTW。