mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 04:20:21 +08:00
Unfortunately introduced an error while fixing #342 in commit a1b2201 in the RKObjectMappingProvider where retrieving mappings by class was broken, partially, yet passed unit tests. This fixes the bug and covers the gap in the tests.
This commit is contained in:
@@ -79,10 +79,10 @@
|
||||
NSMutableArray* mappings = [NSMutableArray array];
|
||||
NSArray* mappingsToSearch = [[NSArray arrayWithArray:_objectMappings] arrayByAddingObjectsFromArray:[_mappingsByKeyPath allValues]];
|
||||
for (NSObject <RKObjectMappingDefinition> *candidateMapping in mappingsToSearch) {
|
||||
if (![candidateMapping respondsToSelector:@selector(objectClass)] || [mappings containsObject:candidateMapping])
|
||||
if ( ![candidateMapping respondsToSelector:@selector(objectClass)] || [mappings containsObject:candidateMapping])
|
||||
continue;
|
||||
Class mappedClass = [candidateMapping performSelector:@selector(objectClass)];
|
||||
if (mappedClass == theClass) {
|
||||
if (mappedClass && [NSStringFromClass(mappedClass) isEqualToString:NSStringFromClass(theClass)]) {
|
||||
[mappings addObject:candidateMapping];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user