I have come to a roadblock in my current project. I basically have an app that is much like the Core Data Recipe app…
Here is the basic structure I have in my .xcdatamodel
Entity: Restaurant
String: name
Category: category <—- to-many relationship
Entity: Category
String: name
Restaurant: restaurant <—- to-many relationship
So basically, a Restaurant can have multiple categories…
And there are a const number of predefined Categories..
For example:
Restaurant:
Name: Chili’s
Categories: Take Out , Family Dining
“Take Out” and “Family Dining” are 2 of 10 different possible Restaurant Categories.
How do I go about doing this.. I have looked at the sqllite database and I have my ZRestaurant and ZCategory table + the join table for both of them… I have data in both…
How do I go about setting my Restaurants Catagory with the different values? and then how do I fetch them back?
Thanks all!
Kurt
OK, After working on this for the past 2 days I finally came up with my solution which was actually a mix between Alex and Wills suggestions… Thank you to both of you!!
Here is what I have…
and then I save like this
And that does it!
Thank you so much for the help you two!!!
-Kurt