gpt4 book ai didi

ios - CKReference .DeleteSelf 属性无效

转载 作者:可可西里 更新时间:2023-11-01 03:57:54 24 4
gpt4 key购买 nike

.DeleteSelf 究竟如何运作?文档说:

When the reference object’s action is set to CKReferenceActionDeleteSelf, the target of the reference—that is, the record stored in the reference’s recordID property—becomes the owner of the source record. Deleting the target (owner) record deletes all its source records.

但我的印象是删除目标并不总是会删除源。当它保留在容器中时非常烦人,客户端下载它,并期望引用指向某个地方,但是在客户端上构建服务器数据存储的切片时目标不存在?

你如何看待这个案例?你无视那种记录?或者您定期查找 CloudKit 存储,搜索损坏的记录以将其删除?

或者与其删除一条记录,不如将其设置为已删除状态的属性,但将其保留在数据库中更好吗?

最佳答案

我刚刚在这个问题上苦苦挣扎了一段时间,我想我会分享我的发现......

这基本上是一个权限问题。仅当删除记录的用户对所有需要删除的记录具有“写入”权限时,级联删除才会起作用。因此,在 CloudKit Dashboard 中,级联删除仅适用于使用开发者的 iCloud 帐户创建的记录。

如果您需要删除不属于删除它们的用户的记录,您可以在安全性下为记录类型添加“写入”权限。

enter image description here

关于ios - CKReference .DeleteSelf 属性无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32788980/

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