JSON I recieve:
1:
{"days":1, "name":"Hans Sarpei"}
2:
{"days":[1,2], "name":"Max Meier"}
Object Mapping:
RKObjectMapping* map = [RKObjectMapping mappingForClass:[self class] ];
[map mapAttributes:@"name", @"days", nil];
Days:
@property(strong) NSArray *days;
If I recieve the second JSON-String, everything works fine. I have 1 and 2 in my days array.
But if i recieve the first JSON-String, my Array is empty.
I get the following Warning:
W restkit.object_mapping:RKObjectMappingOperation.m:239 Failed transformation of value at keyPath 'days'. No strategy for transforming from '__NSCFNumber' to 'NSArray'
Why cant Restkit handle this as an array and is there any workaround?
It is a bug in RestKit, will be fixed in some of the next version.
https://github.com/RestKit/RestKit/issues/1046