Skip to content
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

Merged
merged 3 commits into from
Jan 14, 2012
Merged

NSOrderedSet support #504

merged 3 commits into from
Jan 14, 2012

Conversation

bmorton
Copy link
Contributor

@bmorton bmorton commented Jan 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?

@blakewatters
Copy link
Member

Great work here Brian. There should probably be an additional test serializing an NSOrderedSet to an array. That will cover the serialization use-case.

@bmorton
Copy link
Contributor Author

bmorton commented Jan 14, 2012

Good to go.

blakewatters added a commit that referenced this pull request Jan 14, 2012
Integrate support for NSOrderedSet
@blakewatters blakewatters merged commit e3264a7 into RestKit:master Jan 14, 2012
@blakewatters
Copy link
Member

Brian -

Thanks for the contribution! Welcome to the RestKit contributor community :-D

  • Blake

@bmorton
Copy link
Contributor Author

bmorton commented Jan 14, 2012

Thanks! I look forward to many more :)

@f1337
Copy link
Contributor

f1337 commented Jan 27, 2012

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?

@bmorton
Copy link
Contributor Author

bmorton commented Jan 28, 2012

Good call. I'll take a look at this today and throw something together.

@martijnwalraven
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants