我正在对实体进行聚合,代码是:
NSPredicate *betweenInterval = [NSPredicate predicateWithFormat:@"(date >= %@) AND (date < %@)", [interval.start value], [interval.end value]];
NSNumber * nbPoints = [OMSPointsEventEntity MR_aggregateOperation:@"sum:" onAttribute:@"nbPoints" withPredicate:betweenInterval];
return [nbPoints intValue];
而 NbPoints 为零,我不知道为什么......
提示:我的实体上的属性 NbPoints 是 NSNumber 应该是 int 吗?