How do you manage and use “Many to many” core data relationships?

后端 未结 5 1177
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 15:55

I\'m creating an app and trying to use core data, because it seems like it\'s the objective-C approved way to create a data storage system. The use case I have involves \"ma

5条回答
  •  情深已故
    2020-12-04 16:25

    Possibly what you are stuck on is how to get from the abstract data model realm to a set of objects that you use in code. If so, look into using mogenerator:

    http://rentzsch.github.com/mogenerator/

    That's a command line utility (not sure how well the XCode integration works these days) where you point it at a model, and it gives you sets of data objects you can use. You need to have an object name set for each entity in addition to the entity name.

    The generated data objects have the calls like employee.managers, which would give you a set of Manager entities for an employee, and vice-versa.

提交回复
热议问题