ios - save a label from Xcode to a user in parse using swift -
im trying save label app user class thats created parse when use sign , sign in format. i've tried multiple different ways can't seem find away save data user section. class name user , i'm trying save label column labeled score in user class. code last thing tried do.
@iboutlet weak var label: uilabel!
override func viewdidload() { super.viewdidload() var gamescore = pfobject(classname:"_user") gamescore["score"] = self.label.text gamescore.saveinbackgroundwithblock { (success: bool, error: nserror?) -> void in if (success) { } else { } }
if me awesome because i'm beyond stumped on this. tried looking on google , youtube , going through parse docs on way but, can't seem figure out.
have checked if object saving?
what saving user class use pfuser.currentuser() obtain user table , save object there.
let currentuser = pfuser.currentuser(); currentuser.setobject(self.label.text,forkey:"score"); user.saveinbackgroundwithblock{(success,error)-> void in if(error == nil){ println("success"); } else{ println("error"); } }
Comments
Post a Comment