简体   繁体   中英

Have a object in background as a variable, how to update values (parse.com)

So var touser:PFObject is in the background along with its values, how do i update the value of a array of touser?

Ex. touser.objectforkey("names") is an array of names that had been queried when the user entered the ViewController , how do I update with the current names in that array (others may have added their name to the array and a button shows the values of the array.).

I hope I'm understanding your question correctly.

You want to update your names in the PFObject?

var touser: PFObject
touser.objectForKey("names") as [String] //Assuming 'names' is [String]
let newNames = ["A", "B"]
touser.setObject(newNames, forKey: "names")
touser.saveEventually()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM