我正在构建一个应用,用户可以标记自己对图书的看法。我将此标记对象保存到Parse本地数据存储区,然后将其保存到网络中。我想删除现有的标签PFObject,然后保存更新的对象,这样只有一行包含数据字典。
我不确定我的问题是什么,非常感谢您的反馈!
let tag = PFObject(className: "UserTags")
tag.unpinInBackgroundWithName(bookObjectID, block: { (success, error) -> Void in
if success {
// sets a pointer to the user in the tag
tag["user"] = self.user
// sets pointer to candidate
tag["book"] = PFObject(withoutDataWithClassName:"Books", objectId:self.bookObjectID)
tag["data"] = self.tagsForBookDict
tag["bookObjectID"] = self.bookObjectID
// setting meta dictionary with user values from earlier
tag["meta"] = ["gender":gender, "age":age, "party":party, "state":state]
PFObject.pinAllInBackground([tag], withName: self.bookObjectID, block: { (success, error) -> Void in
print(tag)
})
}
})
}
}