Reputation: 5044
I am trying to figure out how to use Core Data with relationships. I have used Core Data before, but only the very basics sans relationships (which worked for my needs at the time).
I have a Trip
entity that can have many Node
s. When the user presses a "Start" button, I want to initialize the Trip
entity and start storing all of the Node
s inside of that Trip
, and then when the user presses a "Stop" button, I want it to calculate all of the Trip
attributes and store it all together. How do I save with respect to these entities?
Upvotes: 1
Views: 194
Reputation: 8772
Generate the MO subclasses using the IDE, it will create methods for setting the nodesInTrip and tripsInNode relationships.
Upvotes: 1