I'm having some trouble using NSPredicate
predicateWithFormat:argumentArray
:. In this example, serverIDList
is array of strings. Results is an array of NSManagedObjects
with an attribute named "flid" which is a string.
NSMutableString *predicateString = [[NSMutableString alloc] init]; [predicateString appendString:@"(flid IN %@)"]; [results filterUsingPredicate:[NSPredicate predicateWithFormat:predicateString argumentArray:serverIDList]];
The problem is that [NSPredicate predicateWithFormat:predicateString argumentArray:serverIDList]
evaluates to "flid IN '2155'", which is only the first value of the array serverIDList
. I can't seem to get the predicate to evaluate the entire array. Is there something missing here?
Thanks!