mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-12 03:06:30 +08:00
Added specs around behavior of empty mappable payloads and RKObjectLoaderDelegate invocations. Fixed issue where empty hashes ({}) would result in no delegate methods being invoked. fixes #225
This commit is contained in:
@@ -164,7 +164,7 @@
|
||||
return [RKObjectMappingResult mappingResultWithDictionary:[NSDictionary dictionaryWithObject:self.targetObject forKey:@""]];
|
||||
}
|
||||
|
||||
return nil;
|
||||
return [RKObjectMappingResult mappingResultWithDictionary:[NSDictionary dictionary]];
|
||||
}
|
||||
|
||||
id parsedData = [parser objectFromString:bodyAsString error:error];
|
||||
@@ -223,15 +223,11 @@
|
||||
|
||||
NSError* error = nil;
|
||||
_result = [[self performMapping:&error] retain];
|
||||
NSAssert(_result || error, @"Expected performMapping to return a mapping result or an error.");
|
||||
if (self.result) {
|
||||
[self processMappingResult:self.result];
|
||||
} else if (error) {
|
||||
[self didFailLoadWithError:error];
|
||||
} else {
|
||||
// TODO: This is causing no didLoadObject: flavored delegate methods to be invoked.
|
||||
|
||||
// A nil response with an error indicates success, but no mapping results
|
||||
[self finalizeLoad:YES error:nil];
|
||||
}
|
||||
|
||||
[pool drain];
|
||||
|
||||
Reference in New Issue
Block a user