Tag Archives: NSManagedObjectContext

CoreData generic findManyByKey

The base for many of my SELECT-ish queries when querying by exact match is one generic method I created in some category methods on NSManagedObjectContext: -(NSArray*)entityName:(NSString*)entityName findManyByRelation:(NSDictionary*)dict { // TODO handle dict nil and emptyness NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity:dict.count]; for(NSString *key in dict) { NSExpression *left = [NSExpression expressionForKeyPath:key]; NSExpression *right = [NSExpression […]