[英]How do I sort CloudKit results by modified date?
I'm trying to order search results by the modified date. 我正在尝试在修改日期之前订购搜索结果。 If I wanted to do by creationDate its:
如果我想通过creationDate进行操作,请执行以下操作:
query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
What's the key for modified date? 修改日期的关键是什么? A list of all NSSortDescriptor keys or a way to find them would be extremely helpful.
所有NSSortDescriptor键的列表或找到它们的方法将非常有帮助。
Found it on accident after randomly trying 100 things. 随机尝试100件事后偶然发现了它。 It's:
它的:
query.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)]
They key being "modificationDate" I could still use a list of these a info on how to find them. 他们的关键是“ modificationDate”,我仍然可以使用这些信息的列表来查找它们。 -Thanks
-谢谢
You can simply look at the CKRecord keys (metadata) on the Apple website here; 您只需在Apple网站上查看CKRecord键(元数据)即可; https://developer.apple.com/reference/cloudkit/ckrecord
https://developer.apple.com/reference/cloudkit/ckrecord
This is in answer to your last question. 这是对您最后一个问题的回答。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.