Need help with many-to-many relationships in core data for iPhone

前端 未结 4 1505
抹茶落季
抹茶落季 2021-02-09 19:21

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

4条回答
  •  逝去的感伤
    2021-02-09 19:27

    How do I go about setting my Restaurants Catagory with the different values? and then how do I fetch them back?

    The best thing to do is go through the Core Data Tutorial for iPhone, which goes through how to add new managed object instances of an Entity type (in your case, "Restaurant"), set that instance's attributes (e.g., "Restaurant.category") and fetch results.

    The tutorial uses an Entity type called "Event" which has date and location attributes, but the ideas are all the same.

提交回复
热议问题