Database Reference
In-Depth Information
It's OK to leave this relationship as a to-one relationship. A dog can have many
walks, but a walk can only belong to one dog—for the purposes of this app, at least.
:]
The inverse lets the model know how to find its way back, so to speak. Given a
walk record, you can follow the relationship to the dog. Thanks to the inverse, the
model knows to follow the walks relationship to get back to the walk record.
This is a good time to let you know that the data model editor has another view
style. This entire time you've been looking at the table editor style. Toggle the
segmented control on the bottom-right to switch to the graph editor style:
The graph editor style is a great tool to visualize the relationships between your
Core Data entities. Here the to-many relationship from Dog to Walk is represented
with a double arrow. Walk points back to Dog with a single arrow (to-one
relationship).
Feel free to switch back and forth between the two editor styles. You might find it
easier to use the table style to add and remove entities and attributes, and the
graph style to see the big picture of your data model.
 
Search WWH ::




Custom Search