如何为XML元素主体创建RestKit对象映射到对象属性?
XML:
<response>ok</response>
映射:
RKObjectMapping *responseMapping = [RKObjectMapping mappingForClass:[Response class]];
[responseMapping mapKeyPath:@"???" toAttribute:@"body"];
答案 0 :(得分:2)
因此,如果你想在Response.body(谁是Response对象的属性)中使用字符串'ok':
[responseMapping mapKeyPath:@"response" toAttribute:@"body"];
有效吗?