I have Father Entity. Father has a one-to-many relationship with Child. Child has attributes and one of them is name.
I want to perform a fetch request to get: Father.name = "Joe" and out of the fathers named joe I want to fetch those that have a child named Ken: Child.name = "Ken"
So my main objective is to find Ken whose father's name is Joe.
I tried some compound predicates and other things but not luck yet.
Any idea how I can solve this?
thank you
Assuming you want the child:
[NSPredicate predicateWithFormat:@"father.name = %@ AND name = %@", @"Joe", @"Ken"]
should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With