2011-01-25 9 views

答えて

0

実際にはNSFetchRequestにこのような値を計算できます。フェッチ要求を設定して、NSDictionaryResultTypeの結果を返し、適切なNSExpressionDescriptionオブジェクトを作成して、後で実行する操作(最小、最大、合計など)を記述する必要があります。

Appleのコアデータプログラミングガイドhttp://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/Articles/cdFetching.html#//apple_ref/doc/uid/TP40002484-SW6の作業例を見てください。

0

あなたはこのようなあなたの書き込み要求を可能にし、query builderを使用することができます。

NSDictionary *productTotalSumAndAveragePriceGroupedByCountries = 
[[[[[Product all 
] aggregatedBy:@[ 
       @[kAggregateSum, @"amount"], 
       @[kAggregatorAverage, @"price"]] 
] groupedBy:@[@"country"] 
] having:predicate 
] execute]; 
関連する問題