Why do remotely deleted entities not removed from Core Data and the datastore? Setting a breakpoint at the beginning of - (void)deleteCachedObjectsMissingFromResult:(RKObjectMappingResult *)result in RKManagedObjectLoader shows up that the variable result does not contain anything.
I could fix that problem by implementing this feature in the RestKit delegate - (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects but that is kind of unclean code in my point of view. RestKit / Core Data should do that by itself?! Anyway, following implementation would solve the problem:
- (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects
{
NSArray *allReservations = [Reservation findAll];
for(Reservation *reservationRecord in allReservations) {
if(![objects containsObject:reservationRecord]) {
[[[[RKObjectManager sharedManager] objectStore] managedObjectContextForCurrentThread] deleteObject:reservationRecord];
}
}
}
any ideas to solve that problem without the help of didLoadObjects? Adding / updating existing entities works properly.