objective c - 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 , goal_set 2 different sets. "title" in property in objects contained in both sets.

my objective goals rejected if have been met (each goal having unique title).

if have predicate "title in %@" of objects in goal_set rejected. if use "not("title in %@)", none of objects in goal_set rejected.

if print out both sets, see have (but not all) objects in common (that is, title same).

am confused use of "in" nspredicates? how accomplish objective?

try [nspredicate predicatewithformat:@"not (title in %@.title)", prev_set].

your predicates assume prev_set contains nsstring objects, according description, contains objects have string property, never contain titles themselves. hope makes sense.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -