Configure RKManagedObjectImporter to set the mapper operation instance as the parent operation for the RKManagedObjectMappingOperationDataSource instance. This enables relationship connection between objects that are created without an intervening save.

This commit is contained in:
Blake Watters
2013-03-09 17:48:40 -05:00
parent be7ccc7404
commit 1c2cdc4eef

View File

@@ -215,6 +215,7 @@
NSDictionary *mappingDictionary = @{ (keyPath ?: [NSNull null]) : mapping };
RKMapperOperation *mapper = [[RKMapperOperation alloc] initWithRepresentation:parsedData mappingsDictionary:mappingDictionary];
mapper.mappingOperationDataSource = self.mappingOperationDataSource;
self.mappingOperationDataSource.parentOperation = mapper;
__block RKMappingResult *mappingResult;
[self.managedObjectContext performBlockAndWait:^{
[mapper start];