Remove objects persisted to Core Dataduring postObject: when there is an error (Fix Issue #125)

This commit is contained in:
Daniel Hammond
2011-06-16 21:17:14 -04:00
parent 323d5e30b1
commit d9fc311433
5 changed files with 52 additions and 17 deletions

View File

@@ -116,4 +116,11 @@
return nil;
}
// Overloaded to handle deleting an object orphaned by a failed postObject:
- (void)handleResponseError {
[super handleResponseError];
[[self.objectStore managedObjectContext] deleteObject:[self.objectStore objectWithID:_targetObjectID]];
[self.objectStore save];
}
@end