Skip to content

Commit

Permalink
Don't delete objects waiting to be synced!
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Jul 5, 2011
1 parent 1a233ec commit 9b6d62a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Code/CoreData/RKManagedObjectLoader.m
Expand Up @@ -104,8 +104,10 @@ - (void)deleteCachedObjectsMissingFromResult:(RKObjectMappingResult*)result {
NSArray* cachedObjects = [self.objectStore objectsForResourcePath:rkURL.resourcePath];
for (id object in cachedObjects) {
if (NO == [results containsObject:object]) {
RKLogTrace(@"Deleting orphaned object %@: not found in result set and expected at this resource path", object);
[[self.objectStore managedObjectContext] deleteObject:object];
if (0 == ((NSManagedObject*)object)._rkManagedObjectSyncStatus) {
RKLogTrace(@"Deleting orphaned object %@: not found in result set and expected at this resource path", object);
[[self.objectStore managedObjectContext] deleteObject:object];
}
}
}
} else {
Expand Down

0 comments on commit 9b6d62a

Please sign in to comment.