ios - How to get the Entity property from which an average is taken in CoreData -
i've fetched values coredata entity , averaged , groupedby date results. query works great. now... i've want know dates results come from. output shown raw result. how make query spit out date / groupby value (given groupby criteria date) averages taken from the output ( { averageweight = 36; }, { averageweight = 22; } ) the code: nsfetchrequest *request = [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"exercisedata" inmanagedobjectcontext:context]; [request setentity:entity]; // specify request should return dictionaries. [request setresulttype:nsdictionaryresulttype]; // create expression key path. nsexpression *keypathexpression = [nsexpression expressionforkeypath:@"weight"]; // create expression represent function want apply nsexpression *expression = [nsexpression expressionforfunction:@"average:" ...