0
我想運行一個查詢,以獲得數組中的最高10分的球員,我得到零當我運行此查詢,我做錯了什麼?請幫助從解析使用NSArray檢索查詢
var userNames = NSArray!()
var genders = NSArray!()
let query = PFQuery(className: "_User")
query.selectKeys(["topscoreuser", "username"])
query.orderByDescending("topscoreuser")
query.limit = 10
query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error: NSError?) in
if error == nil {
userNames = PFUser.currentUser()?.objectForKey("username") as? NSArray
genders = PFUser.currentUser()?.objectForKey("topscoreuser") as? NSArray
print("\(userNames)")
print("\(genders)")
} else{
//fail
}
}