有没有人有使用经验CloudKit
选项DeleteSelf
for a CKReference
?这是我从文档中得到的信息:
删除自己
引用记录的删除操作。删除记录也会删除包含指向该记录的 CKReference 对象的任何记录。删除附加记录可能会触发更多记录的级联删除。删除在默认区域中是异步的,而在自定义区域中是立即删除。
所以我一直在测试这个,我创建了多个CKReference
对象都使用CloudKit Dashboard
并使用我的应用程序。每当我使用我的应用程序执行此操作时,我都会像这样创建引用:
let reference:CKReference = CKReference(recordID: savedFriend.friendID, action: CKReferenceAction.DeleteSelf)
I know that it is being assigned to delete itself, because in the dashboard it shows the option checked off:
我一定在做某物错误是因为每当我手动删除使用仪表板引用的记录,或者将我的应用程序设置为以编程方式删除它时,记录就会消失,但引用永远不会被删除。我想也许我应该等待,它最终会发生,但几个小时后它仍然在那里被检查,就像它应该已经删除自己一样。这有点令人沮丧,因为我设计了一些代码,假设这会起作用,现在我可以拥有一个浪费资源试图找到一个应用程序的应用程序。CKRecord
那已经不存在了。我不应该依赖这个来工作吗?我很感激我能得到的任何帮助或建议。
更新 ~ 04/07/2016
I jumped the gun coming back here and posting an update that the issue had resolved itself. I wasn't totally convinced that the issue wouldn't pop back up so I sought some reassurance last night. I created 5 different CKRecords
and created various different CKReference
objects to reference them throughout my database. I then proceeded to set the CKReferenceAction.DeleteSelf
option on each reference (I tried two manually through the dashboard and the other three done programmatically). Anyways, I waited a few minutes and then deleted the referenced records...after ten minutes the references were all still present. I waited another 5-10 minutes and they were still there so I went to bed assuming they should definitely be gone by morning, right? Wrong! Twelve hours later the CKReference
entries are still there and the referenced records are still gone. I'm definitely scratching my head, it seems as though it's a bug with CloudKit
. I should mention that I've also noticed some weird behavior in my dashboard. For the past four or so days, down in the bottom left hand corner it has consistently said it's "Reindexing development data", here is a picture for example:
这会导致这个问题吗?有人熟悉这个问题并且知道解决这个问题的方法吗?任何建议,将不胜感激。我已向 Apple 提交了错误报告。