Use the keyPath property to map a subset of the response for a single target object.

This commit is contained in:
Andrew Newdel
2011-04-21 19:24:41 -04:00
parent 9b3428a446
commit bbce5abfd4
3 changed files with 11 additions and 2 deletions

View File

@@ -154,7 +154,7 @@
*/
NSArray* results = nil;
if (self.targetObject) {
[self.objectMapper mapObject:self.targetObject fromString:[response bodyAsString]];
[self.objectMapper mapObject:self.targetObject fromString:[response bodyAsString] keyPath:_keyPath];
results = [NSArray arrayWithObject:self.targetObject];
} else {
id result = [self.objectMapper mapFromString:[response bodyAsString] toClass:self.objectClass keyPath:_keyPath];