ios - How to add multiple data in Parse in the same row at the same time -
i'm using swift code, , code able store data in parse, doesn't place in same row, if please give me feedback on this, i'm self thought , beginner of coding. thanks.
let newtransobject:pfobject = pfobject(classname: "transaction") let pickuptimeobject:pfobject = pfobject(classname: "transaction") let cityobject:pfobject = pfobject(classname: "transaction")
// set text key text of messagetextfield
newtransobject["pickup_location"] = self.myaddress.text pickuptimeobject["pickup_time"] = self.mytime.text cityobject["pickup_city"] = myplacement.locality
//save pfobject
newtransobject.saveinbackground() pickuptimeobject.saveinbackground() cityobject.saveinbackground() self.myaddress.text = "\(myplacement.locality!) \(myplacement.administrativearea!) \(myplacement.postalcode!) \(myplacement.isocountrycode!)" self.myaddress.backgroundcolor = uicolor.whitecolor() [enter image description here][1]print("\(myplacement.locality!) \(myplacement.administrativearea!) \(myplacement.postalcode!) \(myplacement.isocountrycode!)")
you need create 1 pfobject , set variable of that. didn't import parse hope there no errors.
let newtransobject = pfobject(classname: "transaction") newtransobject["pickup_location"] = self.myaddress.text newtransobject["pickup_time"] = self.mytime.text newtransobject["pickup_city"] = myplacement.locality newtransobject.saveinbackground()
Comments
Post a Comment