Core Data: Detecting the type and casting it
- by Tim Sullivan
I have set up a Core Data model that includes an entity, Item with a 1-M relationship with the abstract entity Place, so that an item has many places. There are several entities with the parent set to Place.
I want to set up several UI elements depending on the descendent place types. I have a loop that looks something like this:
for (Place *place in item.places) {
}
... but I'm not sure how to detect what type the place is, and how to cast it to the proper type so that I can access its properties.
Thanks for any help!