RestKit/RestKit — Issue #569: Object Mapping
Author: nikso
Created: 2012-02-25 18:07:47+00:00
State: open

I have provided Mapping for ClassA and serialization mapping for ClassB, in the following manner
RKObjectManager *manager=[RKObjectManager objectManagerWithBaseURL:@"......"];

RKObjectMapping *mapping=[RKObjectMapping mappingForClass:[Class A]];
[mapping forKeyPath:@"name" toAttribute:@"name"];
[manager.mappingProvider setMapping:myRequestMapping forKeyPath:@"responseData"];

RKObjectMapping *mapping2=[RKObjectMapping mappingForClass:[Class B]];
[mapping2 forKeyPath:@"id" toAttribute:@"id"];
[manager.mappingProvider setSerializationMapping:[mapping2 inverseMapping] forClass:[ClassB class]];

ClassB *requestData=[[ClassB alloc] init];
requestData.id=@"123";

[manager postOject:requestData delegate:self];

I received the response correctly , but it is unable to map Objects and is throwing the following error
**Adding mapping error**: Expected an object mapping for class of type 'ClassB', provider returned one for 'Class A'
**Encountered errors during mapping**: Expected an object mapping for class of type 'ClassB', provider returned one for 'ClassA'

Could anyone help me on this issue on urgent basis.

Help Appreciated.