You’re trying to compare a collection (categories.name
) to a scalar value (category.name
). You need to either use a collection comparator (CONTAINS
), or use a predicate modifier (ANY
/ALL
/SOME
, etc).
Try using:
[NSPredicate predicateWithFormat:@"ANY categories.name =[cd] %@", category.name];
Or:
[NSPredicate predicateWithFormat:@"categories.name CONTAINS[cd] %@", category.name];