gpt4 book ai didi

ios - 解析 : How can I update all rows with the same key value

转载 作者:行者123 更新时间:2023-11-29 01:56:06 25 4
gpt4 key购买 nike

如何在 Parse 类中更新具有相同键值的所有行?作为我的代码,如果每个用户有 100 个对象,我认为 Parse 会花费我很多钱。还有其他方法吗?

    let username = PFUser.currentUser()?.username
let objectQuery = PFQuery(className: "FriendList")
objectQuery.whereKey("username", equalTo: username!)

objectQuery.findObjectsInBackgroundWithBlock { (friendList:[AnyObject]?, error:NSError?) -> Void in
if let friendList = friendList as? [PFObject] {
for myInfo in friendList {
myInfo["contact"] = contact
myInfo["portrait"] = PFFile(data: portraitNSData)
myInfo["company"] = company
myInfo["position"] = position
myInfo.save() // create a request?
}
}
}

最佳答案

形成所需对象的数组,而不仅仅是

PFObject.saveAllInBackground(objectsArray)

关于ios - 解析 : How can I update all rows with the same key value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30834904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com