What does the `ordered` flag do in a to-many relationship?

后端 未结 1 1134
無奈伤痛
無奈伤痛 2021-01-04 23:12

While looking for ways to add an ordered to-many relationship to my Core Data model, with the least possible amount of changes to the model, I noticed an option of the to-ma

相关标签:
1条回答
  • 2021-01-04 23:47

    Ordered relationships allow you to assign an arbitrary ordering to related objects. You can think of this as ordering colors from your most to least favorite, rather than sorting by date, title, etc.

    Before this feature was added ordering was implemented by creating a position attribute, then manually updating the position indexes for items whenever the user reordered them. If you have a large number of items, using the built in ordering can be more expensive than implementing this manually, as described above.

    0 讨论(0)
提交回复
热议问题