I have a core data model like so:
SALES_REP <--->> CUSTOMER <---->> PURCHASE_AGREEMENT <<------->> PRODUCTS
I can get the entity description for the Purchase Agreement and I can get the relationships (toCustomer and hasProducts)
[NSEntityDescription relationshipsByName];
but is it possible to get the Sales_Rep as well or do I have to pull that through the CUSTOMER entity?
Thanks
According to your diagram,
SALES_REP
isn't directly related toPURCHASE_AGREEMENT
, it's only linked viaCUSTOMER
. That meansSALES_REP
doesn't know anything aboutPURCHASE_AGREEMENT
on its own. So yes, you'll have to move on to the entity description forCUSTOMER
and ask it for itsrelationshipsByName
. I'm not sure what you're trying to do here, but it would be easy to recursively look up relationships on an entity, then its related entities, and their related entities, etc, until you don't find any new ones.