AFIncrementalStore - best design to prevent some records from being updated

130 Views Asked by At

Here is the use case:

  • I am using AFIncrementalStore, in a fairly standard way
  • When offline, user is still able to update some records
  • I set up my own queue to upload edited records and process the queue when back online
  • When back Online I also refetch data
  • I want to make sure that my updated records don't get re-updated with the old data from the server when back online
  • Whenever I edit a record, I flag it in core data as 'edited', and clear the flag only when it is successfully sent to server

The goal is:

  • when I get results from server, if the results already exist in core data, but are flagged as 'updated' or 'deleted', I don't want them to be refreshed with values from the server

I am looking for the best design to achieve that, out of the box if possible. I would like to avoid subclassing.

0

There are 0 best solutions below