mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-22 11:46:05 +08:00
Add support for mapping an array to an NSOrderedSet.
This commit is contained in:
@@ -160,11 +160,20 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue) {
|
||||
if ([destinationType isSubclassOfClass:[NSArray class]]) {
|
||||
return [(NSSet*)value allObjects];
|
||||
}
|
||||
} else if ([sourceType isSubclassOfClass:[NSOrderedSet class]]) {
|
||||
// OrderedSet -> Array
|
||||
if ([destinationType isSubclassOfClass:[NSArray class]]) {
|
||||
return [(NSOrderedSet*)value array];
|
||||
}
|
||||
} else if ([sourceType isSubclassOfClass:[NSArray class]]) {
|
||||
// Array -> Set
|
||||
if ([destinationType isSubclassOfClass:[NSSet class]]) {
|
||||
return [NSSet setWithArray:value];
|
||||
}
|
||||
// Array -> OrderedSet
|
||||
if ([destinationType isSubclassOfClass:[NSOrderedSet class]]) {
|
||||
return [NSOrderedSet orderedSetWithArray:value];
|
||||
}
|
||||
} else if ([sourceType isSubclassOfClass:[NSNumber class]] && [destinationType isSubclassOfClass:[NSDate class]]) {
|
||||
// Number -> Date
|
||||
return [NSDate dateWithTimeIntervalSince1970:[(NSNumber*)value intValue]];
|
||||
|
||||
Reference in New Issue
Block a user