jumponadoughnut
jumponadoughnut

Reputation: 125

RestKit map XML element body

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

Answers (1)

Beber
Beber

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

Related Questions