How to fetch even and odd values from core data using Predicate
问题 I want to fetch even and odd values from my core data entity, please look into below code and correct, because its crashing the app. NSPredicate *predicate; if ([leadFilter.rank isEqualToString:@"Even"]) { predicate = [NSPredicate predicateWithFormat:@"(street%2) = 0"]; } else predicate = [NSPredicate predicateWithFormat:@"street%2 != 0)"]; [predicateArray addObject:predicate]; Its saying unable to parse street%2=0. 回答1: You can do this directly in Core Data, but the syntax is a little hairy.