itsniper / FTASync

Allows you to sync CoreData entities with a Parse backend.
MIT License
311 stars 59 forks source link

Is this scenario possible with FTASync? #1

Closed gordemota closed 12 years ago

gordemota commented 12 years ago

Here are possible scenario:

On parse server, there are 1000 rows of data The first time ViewController loaded, it will pull 50 rows of data using FTASync user tap "Load More", to load another 50 rows of data. --- How to use FTASync to load another 50 rows of data and not the previous one? Or the from code, using updatedDate?

from the code, there is syncAll and syncEntity but I did not see sync base on certain numbers of rows.

itsniper commented 12 years ago

That is not really the intention of FTASync. The purpose of FTASync is to replicate the entire remote DB into a local CoreData store. This allows the sync feature to be much more transparent to the user, since everything is handled in the background. So if you are worried about the performance impact of >1,000 records, I have not tested that scenario. However, everything is done in a background thread so there should be no impact to the UI.

If you want the pagination, you can do that with your NSFetchRequest and batch size and offset once the data is loaded into CoreData.

Also, as a warning Parse only supports returning 1,000 records from their queries. I have not yet added support in FTASync to check the return count and fire off another query if there were >1,000 records. But that if/when that gets implemented it will be handled automatically, and not visible to the user.