I have a main data object and a REST web interface that use different values ββfor the same attribute. The managed object has an attribute named "type", which is an integer (enum), the REST interface has a string value with the name "type" (strings such as "truck", "car", "moped").
I convert the value from a string to an integer when I get the object using the RKObjectLoaderDelegate method objectLoader:willMapData:. Hope I have to do it.
objectLoader:willMapData:
My question is: when you send / send an object, how and where can I convert a value from integer (enum) back to string values? Is there a point in the serialization process where I can manipulate the values ββfor the put / post action? Should I intercept the subclass with a serializer or RKManagedObjectMapping, or is my delegate called at some point so that I can change the attribute values?
, (NSManagedObject), , , Restkit. typeString , () "typeString" json, "type". :
[mapping mapKeyPath:@"type" toAttribute:@"typeString"]
:
[serializationMapping mapKeyPath:@"typeString" toAttribute:@"type"]
, objectLoader:willMapData:, ().