mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-07 23:06:59 +08:00
Remove objects persisted to Core Dataduring postObject: when there is an error (Fix Issue #125)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user