ios,core-data,nsfetchrequest,nsexpression,nsexpressiondescription
Not every expression that's valid for NSExpression is valid for use when fetching from Core Data when using a SQLite store. Unfortunately sqrt: is not supported for this kind of use. It would probably work with a binary store, but that loses many of the advantages of Core Data (it...
Best I can come up with is: NSError* error; NSManagedObjectContext* context = self.managedObjectContext; NSEntityDescription* entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:context]; // Construct a count group field NSExpressionDescription* count = [NSExpressionDescription new]; count.name = @"count"; count.expression = [NSExpression expressionWithFormat:@"count:(value)"]; count.expressionResultType = NSInteger64AttributeType; // Get list of all "value" fields (only) NSPropertyDescription* value...