我一直在尝试更改Collabs类中名为testArray的数组中的内容,然后将其保存回解析服务器。
@IBAction func addToArray(_ sender: AnyObject) {
var objectToSave: PFObject?
let query = PFQuery(className: "Collabs")
query.getObjectInBackground(withId: collabID) { (object, error) in
if error != nil {
print(error)
} else if let content = object {
objectToSave = content
}
if objectToSave != nil {
objectToSave!["testArray"] = ["foo","bar","foobar"]
objectToSave!.saveInBackground(block: { (success, error) in
if error != nil {
print("ERROR")
} else {
print("SUCCESS")
}
})
}
}
我已经看过很多关于访问权限的帖子,但据我所知,Collabs类已经启用了公共读写功能
答案 0 :(得分:0)
private