-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSOrderedSet support #504
NSOrderedSet support #504
Conversation
Great work here Brian. There should probably be an additional test serializing an NSOrderedSet to an array. That will cover the serialization use-case. |
Good to go. |
Integrate support for NSOrderedSet
Brian - Thanks for the contribution! Welcome to the RestKit contributor community :-D
|
Thanks! I look forward to many more :) |
NSOrderedSet is only available for iOS 5+. RestKit does not compile in my iOS 4.x projects unless I comment-out this NSOrderedSet support. How do you feel about a compiler flag around the NSOrderedSet lines? |
Good call. I'll take a look at this today and throw something together. |
Support for NSOrderedSet in applyRelationshipMappings: in RKObjectMappingOperation is still missing. This seems to work for me: // If the relationship has changed, set it
[...]
} else if ([destinationObject isKindOfClass:[NSOrderedSet class]]) {
RKLogTrace(@"Mapped NSOrderedSet relationship object from keyPath '%@' to '%@'. Value: %@", relationshipMapping.sourceKeyPath, relationshipMapping.destinationKeyPath, destinationObject);
[self.destinationObject setValue:destinationObject forKey:relationshipMapping.destinationKeyPath];
} We're not able to use mutableOrderedSetValueForKey: because NSMutableOrderedSet doesn't have a method like setOrderedSet: to replace the whole collection. |
This fixes issue #483 and adds support for NSOrderedSet in RKObjectMappingOperation. I've added a test to add coverage for the mapping, does anything need to be added to test core data or that issue more specifically?