Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
NSOrderedSet support #504
Conversation
bmorton
added some commits
Jan 13, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
blakewatters
Jan 13, 2012
Owner
Great work here Brian. There should probably be an additional test serializing an NSOrderedSet to an array. That will cover the serialization use-case.
Great work here Brian. There should probably be an additional test serializing an NSOrderedSet to an array. That will cover the serialization use-case. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Good to go. |
added a commit
that referenced
this pull request
Jan 14, 2012
blakewatters
merged commit e3264a7
into
RestKit:master
Jan 14, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
blakewatters
Jan 14, 2012
Owner
Brian -
Thanks for the contribution! Welcome to the RestKit contributor community :-D
- Blake
Brian - Thanks for the contribution! Welcome to the RestKit contributor community :-D
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Thanks! I look forward to many more :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
f1337
Jan 27, 2012
Contributor
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?
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? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
bmorton
Jan 28, 2012
Contributor
Good call. I'll take a look at this today and throw something together.
Good call. I'll take a look at this today and throw something together. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
martijnwalraven
Feb 28, 2012
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.
martijnwalraven
commented
Feb 28, 2012
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. |
bmorton commentedJan 13, 2012
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?