Hi there,
i struggling around NSFetchRequest these days. My data model look like this:
Post <->> Category
Now i need a fetch request to get all posts where the category.name attribute is not "xxx". Looking at the documentation for NSFetchRequest is should be:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NONE category.name == %@", categoryName]
But this results in an empty list (the request is used by NSFetchedResultsController in an UITableView.
The docs say:
NONE Specifies none of the elements in the following expression. For example, NONE children.age < 18. This is logically equivalent to NOT (ANY ...).
If i invert my predicate to
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY category.name == %@", categoryName]
the list contains exactly the objects i want to be excluded from that list.
What am i missing here?
thanks in advance