RestKit映射XML元素主体

时间:2012-02-08 16:04:01

标签: objective-c ios restkit

如何为XML元素主体创建RestKit对象映射到对象属性?

XML:

<response>ok</response>

映射:

RKObjectMapping *responseMapping = [RKObjectMapping mappingForClass:[Response class]];
[responseMapping mapKeyPath:@"???" toAttribute:@"body"];

1 个答案:

答案 0 :(得分:2)

因此,如果你想在Response.body(谁是Response对象的属性)中使用字符串'ok':

[responseMapping mapKeyPath:@"response" toAttribute:@"body"];

有效吗?