I need to map a web service with object properties all in caps against coredata object properties all in lowercase:
# JSON
{
'ID': 'value',
'TITLE': 'value',
'BODY': 'value',
}
# CoreData Entity
{
'id': 'value',
'title': 'value',
'body': 'value',
}
I mapped the fields by doing:
RKEntityMapping *entMap = [RKEntityMapping mappingForEntityForName:entName
inManagedObjectStore:managedObjectStore];
NSEntityDescription *entity = [[managedObjectModel entitiesByName]
objectForKey:entName];
[entMap addAttributeMappingsFromArray:[[[RKPropertyInspector sharedInspector]
propertyInspectionForEntity:entity] allKeys]];
I saw this convenient setDefaultSourceToDestinationKeyTransformationBlock fonction in RKObjectMapping allowing to define custom transformation on object properties. This is not available on RKEntityMapping.
How can I do property transformations with RKEntityMapping without defining fields manually ?