I'm trying to run a query to have the best 10 player with a high score in an array, I get nil when I run this query, what am I doing wrong ? please help
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
}
}