I am creating a game for the iPhone, and the main screen is a list of games that the current user has in progress. I want to use the parse local datastore because my queries take a long time when there are a lot of games in progress. I have a question about the datastore that does not seem to be answered clearly in the docs.
When the app opens, I query my table of games in the background, sort them based on status (your turn, their turn, over), and display them in a table. In order to speed this process up I would like to pin all of these objects to the local datastore.
When the user refreshes the tableview to see if any of the game statuses have changed, I would like to query the datastore to retrieve all of the relevant objects, but then also query the network for any changes in the objects, and for any new ones. However, it does not seem that there is anyway to make the local datastore "up-to-date". The only way I have seen is to query the network completely, unpin currently stored objects, and pin the newly retrieved objects. If this is the case, I do not see the point in using the local datastore because my queries will be just as slow.
Basically, everytime the user pulls to refresh the table, I would like the datastore to be queried, and then the network to check for any new objects or changed columns.
So, is there a way to query the local datastore and subsequently update those objects and/or add new ones from the network?
I have also realized that I am doing quite a bit of sorting. Could this have an affect on the long wait time for the table to load?