Fetch aggregate data from NSManagedObject using another expression as argument to sum: expression
问题 Is it possible to use expression as argument for sum: expression? I have entity ( NSManagedObject class) Drink with properties costPerDrink , numberOfDrinks and drinkingDate . I would like to get sum of total costs ( numberOfDrinks multiplied by costPerDrink ) within time period. While I have no problems getting sum on single property (e.g. sum of numberOfDrinks within time period), when I try to use sum expression on another (multiply) expression I got error: NSInvalidArgumentException,