My approach was to write a utility that checks if something has been updated or deleted in the cloud. Every time I needed to perform an update, I called:
[[ParseLocalDataStoreManager sharedInstance]updateClasses:classes];
I kept track of which classes were already in localStore and which weren't. If the class was not, then I requested and bound all its objects. If that were the case, I would only update the objects that were changed in the cloud after the last date I updated. I used Parse's
[query whereKey:@"updatedAt" greaterThanOrEqualTo:lastUpdated];
and saved the lastUpdated entry in "NSUserDefaults".
To remove objects that were no longer in the cloud, I wrote a small cloud function that returned objects in the cloud for a specific class. Then I compared them to what I had in localStore, and deleted those that were not in the Cloud.
In my case, I update every time the user opens the application, since it did not require a real-time update. But if you need real-time updates, you can set a timer and call the function update with the classes you want to update in real time.
I downloaded the utility on github: https://github.com/timpalade/ParseLocalDataStoreManager
You can find instructions on github as well as cloud code. Hope this helps!
Tim p source share