Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Making newValueForRelationship callback more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Jun 19, 2013
1 parent 75524b5 commit 2667968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions AFIncrementalStore/AFIncrementalStore.m
Expand Up @@ -825,9 +825,10 @@ - (id)newValueForRelationship:(NSRelationshipDescription *)relationship
id representationOrArrayOfRepresentations = [self.HTTPClient representationOrArrayOfRepresentationsOfEntity:relationship.destinationEntity fromResponseObject:responseObject];

[self insertOrUpdateObjectsFromRepresentations:representationOrArrayOfRepresentations ofEntity:relationship.destinationEntity fromResponse:operation.response withContext:childContext error:error completionBlock:^(NSArray *managedObjects, NSArray *backingObjects) {
NSManagedObjectID *backingObjectID = [self objectIDForBackingObjectForEntity:[objectID entity] withResourceIdentifier:AFResourceIdentifierFromReferenceObject([self referenceObjectForObjectID:objectID])];
NSManagedObject *managedObject = [childContext objectWithID:objectID];
NSManagedObject *backingObject = [[self backingManagedObjectContext] existingObjectWithID:backingObjectID error:nil];

NSManagedObjectID *backingObjectID = [self objectIDForBackingObjectForEntity:[objectID entity] withResourceIdentifier:AFResourceIdentifierFromReferenceObject([self referenceObjectForObjectID:objectID])];
NSManagedObject *backingObject = (backingObjectID == nil) ? nil : [[self backingManagedObjectContext] existingObjectWithID:backingObjectID error:nil];

if ([relationship isToMany]) {
if ([relationship isOrdered]) {
Expand Down

0 comments on commit 2667968

Please sign in to comment.