Core Data - Relationship to dissimilar entities

Posted by carotene on Stack Overflow See other posts from Stack Overflow or by carotene
Published on 2010-03-23T17:30:17Z Indexed on 2010/03/23 17:33 UTC
Read the original article Hit count: 263

Suppose I have the following data model:

Entity Person Attribute name String Attribute personType String Attribute dailyRecords

Entity CarpenterDailyRecord Attribute numberOfNailsHammered Int Attribute picNameOfFinishedCabinet String

Entity WindowWasherDailyRecord Attribute nameOfBuildingWashed String Attribute numberOfWindowsWashed Int

I would like to establish a to-many relationship between the Person.dailyRecords and 1 of the daily record entities (which changes depending on the person type). Of course, i could create a CarpenterPerson and WindowWasher entity which each points to it's unique daily record structure, but i have to group people together in my app somehow.

so if i do a Group Entity:

Entity Group Attribute people array

i'm still stuck. how do i point to multiple & different Person entities?

There must be an obvious answer, it's just i'm so new to all of this. thanks!

© Stack Overflow or respective owner

Related posts about core-data

Related posts about entity-relationship