Question: in my app Im trying to give the user points every time they create an event. I am setting up a PFQuery to retrieve the current score then saving the required points back to the class. My problem is that I can't update the score once it has been created so I need a way to "Update" the current score data with the added score.  

This is my code:

```
// Give the User Points

    let saveScore = PFUser.currentUser()

    var query = PFQuery(className:"User")
    query.whereKey("score", equalTo: saveScore!)
    query.findObjectsInBackgroundWithBlock ({
        objects, error in

        if error == nil {
            // The find succeeded.
            println("Successfully retrieved \(objects!.count) scores.")
            // Do something with the found objects
            if let objects = objects as? [PFObject] {
                for object in objects {

                    let Score = object["score"] as! String

                    println(object.objectId)

                    let Points = ("100" + Score)

                    saveScore!.setObject(Points, forKey: "score")

                    saveScore!.saveInBackgroundWithBlock { (success: Bool,error: NSError?) -> Void in
                        println("Score added to User.");

                    }
                }
            }
        } else {
            // Log details of the failure
            println("Error: \(error!) \(error!.userInfo!)")
        }
    })

```

Can anyone help? 
Thanks

Answer: 
Since you already have the current user there's no reason to query it. However you should fetch it if needed to make sure you're working with the latest data. Once fetched set your score variable, add the 100 string and then save the updated score variable, like so:

```
if let currentUser = PFUser.currentUser() {

        currentUser.fetchIfNeededInBackgroundWithBlock({ (foundUser: PFObject?, error: NSError?) -> Void in

            // Get and update score

            if foundUser != nil {

                let score = foundUser!["score"] as! String

                let points = "100" + score

                foundUser!["score"] = points

                foundUser?.saveInBackgroundWithBlock({ (succeeded: Bool, error: NSError?) -> Void in

                    if succeeded {

                        println("score added to user")
                    }
                })

            }

        })

    }

```
You need to query for the saved object and then just save like normal. It will update like so: 

```
 var query = PFQuery(className:"GameScore")
 query.getObjectInBackgroundWithId("xWMyZEGZ") {
 (gameScore: PFObject?, error: NSError?) -> Void in
 if error != nil {
 println(error)
 } else if let gameScore = gameScore {
 gameScore["cheatMode"] = true
 gameScore["score"] = 1338
 gameScore.saveInBackground()
 }
}

```