![](/img/trans.png)
[英]How do I sort core data objects by date modified and list it in the right order in a tableView?
[英]How do I sort CloudKit results by modified date?
我正在嘗試在修改日期之前訂購搜索結果。 如果我想通過creationDate進行操作,請執行以下操作:
query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
修改日期的關鍵是什么? 所有NSSortDescriptor鍵的列表或找到它們的方法將非常有幫助。
隨機嘗試100件事后偶然發現了它。 它的:
query.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)]
他們的關鍵是“ modificationDate”,我仍然可以使用這些信息的列表來查找它們。 -謝謝
您只需在Apple網站上查看CKRecord鍵(元數據)即可; https://developer.apple.com/reference/cloudkit/ckrecord
這是對您最后一個問題的回答。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.