Reputation: 535
I try to add an object to a PFUser using the following code:
@IBAction func ButtonPressed(sender: AnyObject) {
var user = PFUser.currentUser()
user.addObject("test", forKey: "surname")}
But unfortunately I get no value on my Parse Dashboard. I don't understand why Thanks
Upvotes: 0
Views: 290
Reputation: 53112
Did you save?
var user = PFUser.currentUser()
user.addObject("test", forKey: "surname")}
user.saveInBackground()
Also a couple notes. You could use a let
here as your user variable shouldn't change its pointer, and subscript syntax is more readable (my opinion) :)
let user = PFUser.currentUser()
user["test"] = "surname"
user.saveInBackground()
Upvotes: 1