The configuration of mapping for Core Data objects is quite similar to normal mapping configuration, though there are a few differences. First, initializing of mapping is done differently. So if we had:
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:itemClass];
We need to change it to:
// Get default managed object store RKManagedObjectStore *managedObjectStore = [RKManagedObjectStore defaultStore]; // Create mapping for entity RKEntityMapping *mapping = [RKEntityMapping mappingForEntityForName:@"Database" inManagedObjectStore:managedObjectStore];
Additionally, it's a good practice to tell RestKit how to distinguish the object's uniqueness by providing identification attributes:
// How to identify if the object we got is in database ...