I have an entity called Entry
, which has a one-to-many relationship with an entity called Media
. The relationship name, from the Media
side, is entry
. Entry has an attribute named entryID
, and I want to create a NSPredicate on media entities which returns all where their entry
relationship has a particular entryID
. How do I do this?
Asked
Active
Viewed 156 times
1

Andrew
- 15,935
- 28
- 121
- 203
1 Answers
2
Assuming the relationship you want to fetch is called entry
and entryID
is some kind of number type.
NSNumber *desiredID = @(12345);
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"entry.entryID = %@", desiredID];

brynbodayle
- 6,546
- 2
- 33
- 49