Added support for polymorphic object mapping (Github #105, #244). This enables you to dynamically map objects to different destination classes or using different mapping strategies via configuration or callbacks. See Docs/Object Mapping.md for details.

Other changes include:
* Eliminated the RKObjectFactory protocol and implementations. Object mapping instances themselves are
now responsible for instantiating target objects for mapping.
* Introduced RKObjectAbstractMapping superclass for RKObjectMapping and RKObjectPolymorphicMapping.
* Updated example applications to use block object loaders (RKTwitter and RKTwitterCoreData)
* Refactored method signatures of RKObjectMapper, RKObjectMapping, and RKObjectMappingProvider to reflect the
existence of abstract mapping types. This was necessary to make polymorphic mappings integrate cleanly.
* Fixed overlap in RestKit error domains between network and object mapping. fixes #208
This commit is contained in:
Blake Watters
2011-07-30 16:00:36 -04:00
parent 072e1ee58b
commit 670234b775
64 changed files with 1411 additions and 601 deletions

View File

@@ -78,7 +78,7 @@
if (mapping) {
NSError* error = nil;
TTTableItem* tableItem = [[mapping.objectClass new] autorelease];
RKObjectMappingOperation* operation = [RKObjectMappingOperation mappingOperationFromObject:mappableObject toObject:tableItem withObjectMapping:mapping];
RKObjectMappingOperation* operation = [RKObjectMappingOperation mappingOperationFromObject:mappableObject toObject:tableItem withMapping:mapping];
BOOL success = [operation performMapping:&error];
if (success) {
return tableItem;