Baub
Baub

Reputation: 5044

Core Data Relationship Saving

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).

Relationship

I have a Trip entity that can have many Nodes. When the user presses a "Start" button, I want to initialize the Trip entity and start storing all of the Nodes 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

Answers (1)

logancautrell
logancautrell

Reputation: 8772

Generate the MO subclasses using the IDE, it will create methods for setting the nodesInTrip and tripsInNode relationships.

Upvotes: 1

Related Questions