What does the `ordered` flag do in a to-many relationship?
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-many relationship that says
ordered (see screenshot below). Wow, sounds great, but what does it do?
My SQLite store is not complaining when I check or uncheck it, and my app still compiles and runs fine too. I was thinking maybe the lightweight migration takes care of the change, but from the looks of it, all my custom
NSManagedObject subclasses work without the need for modification too, so what’s going on?
To summarize the questions:
- Should that
orderedflag change the to-many relationship’s data type from
- Or is it just that the order in which the set is modified, will persist on sequential reads and writes?
- Or am I wrong with my assumptions and is it something else entirely?
- Is there an Apple doc page where this feature is described?
Solutions Collect From Internet About “What does the `ordered` flag do in a to-many relationship?”
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.
- How do I use UIActivityItemProvider to send an email with attachment with UIActivityViewController?
- Android Toast in iPhone?
- How to do Custom Fonts at design time in Xcode 6?
- Compiler gives warning on performSelectorOnMainThread:@selector(delegateMethod)
- @import causes parse issue: “could not build module”
- One Signal – idsAvailable is deprecated
- How to Implement GPUImageMaskFilter using GPUImage
- How do you set an Attributed Title Color for State in Swift
- Delete a UITableView row by click on custom UIButton
- In new Firebase, how to use multiple config file in xcode?
- How can I get the file path from a UIImage?
- Using AFNetworking to post both text and multiple images to Google Blobstore
- SenTestCase in Xcode 3.2 and XCBuildLogCommandInvocationSection Errors
- How to create a custom keyboard
- How to get all the application's ViewControllers in iOS?