1
I have a one-to-many relationship between entities Pai
and Filho
, where a Pai
may have any or N Filho
.
Using the Core Data
, how do I fetch all the Filho
, basing my search for a Pai
.
For example:
I have a Pai
who owns the Id
1. I need to fetch all the Filho
who has the Pai
with the Id
1.
Blz, what if it’s a long-term relationship? This does not exist but suppose it exists, it would be through the intermediate table that Core Data itself creates?
– Gian
In relation to
to-many
if you use the keywordany
. Example:[NSPredicate predicateWithFormat:@"ANY RelacionamentoPai.Id == %d", 1];
– Otávio