I am having problems with my NSPredicate
I'm trying the following comparison but it does not work.
What is the appropriate syntax to use both the or/and operator within the same context?
N开发者_开发百科SPredicate* predicate = [NSPredicate predicateWithFormat:@"((day || day2 ==%@) && CourseTitle==%@)",day,courseSelected];
rows = [[courseArray filteredArrayUsingPredicate:predicate]retain];
Try:
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"(((day == %@) OR (day2 == %@)) && CourseTitle==%@)",day, day, courseSelected];
rows = [[courseArray filteredArrayUsingPredicate:predicate]retain];
精彩评论