How do I make RestKit not delete but update existing objects?
On every GET I receive same objects. But rest kit deleted existing objects and replaces them with identical copies.
Object mapping:
RKManagedObjectMapping* itemMapping = [RKManagedObjectMapping mappingForClass:[Item class] inManagedObjectStore:objectStore];
itemMapping.primaryKeyAttribute = @"itemId";
[itemMapping mapKeyPath:@"id" toAttribute:@"itemId"];
RKResponse.m:218 Read response body: [{"id":144614501} ......
estkit.core_data:RKManagedObjectLoader.m:143 Deleting orphaned object <Item: 0xc93ad60> (entity: Item; id: 0xc935c20 <x-coredata://03AD71D5-2841-434D-8482-E840B879EC20/Item/p478> ; data: {
itemId = 144614501;
RKOBjectLoader - (RKObjectMappingResult*)mapResponseWithMappingProvider:(RKObjectMappingProvider*)mappingProvider toObject:(id)targetObject inContext:(RKObjectMappingProviderContext)context error:(NSError**)error;
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 managedObjectContextForCurrentThread] deleteObject:object];
}
}