Reputation: 1403
I want to update the telephone column and name column in the User Class with new values entered by user. I am using the same code recommended by Parse. Avoided changing anything except what is needed to try it out, but it is triggering an error. This is the error I get when I click to update the telephone and name of the user.
2015-12-08 20:55:26.044 Mawq[39532:1084556] [Error]: No results matched the query. (Code: 101, Version: 1.10.0) Optional(Error Domain=Parse Code=101 "No results matched the query." UserInfo={error=No results matched the query., NSLocalizedDescription=No results matched the query., code=101})
and this is the code in the function:
if(nameTextField.text != "" && telephoneTextField.text != "")
{
/*Update*/
let query = PFQuery(className:"User")
query.getObjectInBackgroundWithId(PFUser.currentUser()!.objectId!) {
(gameScore: PFObject?, error: NSError?) -> Void in
if error != nil {
print(error)
} else if let gameScore = gameScore {
print("Telephone New: " + self.telephoneTextField.text!);
gameScore["telephone"] = self.telephoneTextField.text!
gameScore["name"] = self.nameTextField.text!
gameScore.saveInBackground()
}
}
}
And the parse documentation is here: https://parse.com/docs/ios/guide#objects-updating-objects
Upvotes: 2
Views: 548
Reputation: 9389
The problem might be the fact that Parse uses the User className as "_User".
So try:
let query = PFQuery(className:"_User")
Upvotes: 2