Reputation: 999
what is a problem with this predicate:
NSPredicate *predicate1 = [NSPredicate predicateWithFormat:@"(category like[cs] %@) AND (aroundme==YES)",category];
? Thks.
Upvotes: 0
Views: 326
Reputation: 999
excuse me the problem was not there .. i did'nt add the category attribute to the DB
Upvotes: 0
Reputation: 1061
I think you need to instead pass in [NSNumber numberWithBool:YES] to aroundme==%@ like so:
NSPredicate *predicate1 = [NSPredicate predicateWithFormat:@"(category like[cd] %@) AND (aroundme==%@)",category, [NSNumber numberWithBool:YES]];
That is unless you are looking for the string 'YES'. Then, the resulting predicate should quote YES.
Upvotes: 0
Reputation: 243156
There is no such thing as an [s]
comparison modifier. The only ones are [c]
, [d]
, or [cd]
.
Upvotes: 3