我想从我的核心数据实体中获取偶数和奇数值,请查看下面的代码并更正,因为它崩溃了应用程序.
NSPredicate *predicate;
if ([leadFilter.rank isEqualToString:@"Even"]) {
predicate = [NSPredicate predicateWithFormat:@"(street%2) = 0"];
}
else
predicate = [NSPredicate predicateWithFormat:@"street%2 != 0)"];
[predicateArray addObject:predicate];
Run Code Online (Sandbox Code Playgroud)
它的说法无法解析街道%2 = 0.