mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-04-29 20:46:37 +08:00
@@ -196,7 +196,7 @@ There are also counterpart methods which return NSUInteger rather than NSNumbers
|
||||
|
||||
#### Aggregate Operations
|
||||
|
||||
NSPredicate *prediate = [NSPredicate predicateWithFormat:@"diaryEntry.date == %@", today];
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"diaryEntry.date == %@", today];
|
||||
int totalFat = [[CTFoodDiaryEntry MR_aggregateOperation:@"sum:" onAttribute:@"fatColories" withPredicate:predicate] intValue];
|
||||
int fattest = [[CTFoodDiaryEntry MR_aggregateOperation:@"max:" onAttribute:@"fatColories" withPredicate:predicate] intValue];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user