NSPredicates and NSSets, how to reject things in the intersection of two
sets?
My code looks like:
NSPredicate* pred = [NSPredicate predicateWithFormat:@"(title IN %@)",
prev_set];
NSSet* remainingSet = [goal_set filteredSetUsingPredicate:pred ];
Where prev_set and goal_set are two different sets. "title" in a property
in the objects contained in both sets.
My objective is so that all goals are rejected if they have previously
been met (each goal having a unique title).
If I have a predicate like "title in %@" ALL of the objects in goal_set
are rejected. If I use "NOT("title in %@)", then NONE of the objects in
goal_set are rejected.
If I print out both sets, I see that they clearly have some (but not all)
objects in common (that is, their title is the same).
Am I completely confused about the use of "IN" for NSPredicates? How would
I accomplish my objective?
No comments:
Post a Comment