Reputation: 125
How do I create a RestKit object mapping for an XML element body to an object attribute?
XML:
<response>ok</response>
Mapping:
RKObjectMapping *responseMapping = [RKObjectMapping mappingForClass:[Response class]];
[responseMapping mapKeyPath:@"???" toAttribute:@"body"];
Upvotes: 2
Views: 702
Reputation: 1513
So if you want the string 'ok' in Response.body (who is an attribute of Response object) :
[responseMapping mapKeyPath:@"response" toAttribute:@"body"];
It works ?
Upvotes: 2