I'm working on an app and I need to sync objects with my API. I use RestKit 0.20.3.
The sync process begins by pulling objects from the server, and then pushes the objects that have been modified inside the app by the user. Therefore, during the pull step, I need to ignore the objects that have been modified locally, so they won't be overriden with the server version.
I use CoreData for my objects, and I set a boolean property "modified" to YES for those that are locally modified. So after a GET during the sync, I need to skip the mapping step for the objects having this "modified" property, but I can't find exactly how I'm supposed to do that.
The only way I've found so far is by adding a condition directly inside the RKMappingOperation
, but it's dirty.
Is there a better way to do that in RestKit (and by not modifying the RestKit code)?