Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
想知道,如果可能的话,我将如何按照创建顺序对 NSSet 中的实体进行排序。
我可以按某些属性对它们进行排序,但不知道如何按创建顺序排序。
谢谢
使用 Core Data 执行此操作的唯一方法是在中提供一个creationDate字段Entity并填写它。例如,您可以在实体本身中填充它-willSave,以便处理您的模型的控制器不必弄乱它。
creationDate
Entity
-willSave