I have an Exit object. Every Exit has an array of Category objects.
Objects look like this :
Category: (id, name)
Exit: (id,name,number,...,NSArray(Categories),...)
I want to use NSPredicate to filter out exits by Category name they have in Category array, but I'm not sure how exactly to write it down. If I'd wanted to filter out Exits by Exit name, for example, I would do this
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.exitName = %@", name];
NSArray *results = [exits filteredArrayUsingPredicate:predicate];
But I'm not sure how to get into the Categories array and search by Category Name.
Any suggestions ?
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY SELF.categories.name CONTAINS[c] %@", name];categoriesis an NSArray and does not have a name property.