Docs for RKResponseMapperOperation

This commit is contained in:
Blake Watters
2012-09-12 23:35:30 -04:00
parent ea0fe1eab6
commit 194ee16a8e
2 changed files with 121 additions and 18 deletions

View File

@@ -151,7 +151,7 @@
// If we are successful and empty, we may optionally consider the response mappable (i.e. 204 response or 201 with no body)
if ([self hasEmptyResponse] && self.treatsEmptyResponseAsSuccess) {
if (self.targetObject) {
self.mappingResult = [RKMappingResult mappingResultWithDictionary:[NSDictionary dictionaryWithObject:self.targetObject forKey:@""]];
self.mappingResult = [RKMappingResult mappingResultWithDictionary:[NSDictionary dictionaryWithObject:self.targetObject forKey:[NSNull null]]];
} else {
self.mappingResult = [RKMappingResult mappingResultWithDictionary:[NSDictionary dictionary]];
}
@@ -209,8 +209,7 @@
RKObjectMapper *mapper = [[RKObjectMapper alloc] initWithObject:sourceObject mappingsDictionary:self.responseMappingsDictionary];
mapper.delegate = self.mapperDelegate;
mapper.mappingOperationDataSource = self.mappingOperationDataSource;
// TODO: if ([self.response isSuccessful] -- Encapsulate HTTP response helpers in category on NSHTTPURLResponse
if (NSLocationInRange(self.response.statusCode, RKStatusCodeRangeForClass(RKStatusCodeClassSuccessful))) {
mapper.targetObject = self.targetObject;