Time based sync with restkit

亡梦爱人 提交于 2019-12-08 08:12:13

问题


Our app consumes a web api and also uses core data. We are successfully using Restkit to send and receive data between the app and the database. However we are having difficulty implementing a conditional sync between the server and the app.

One of the tables on the server has an 'updated_at' field. The table corresponds to a NSManagedObject on our iOS application. We are trying to establish a means of updating the managed object on the device only if the 'updated_at' field being called from the server is newer, or later, than the one on the device.

It would appear that the RKObjectManager maps to core data before its completion block is called, and therefore does not allow us to perform the necessary synchronisation logic in the completion block.

Could someone outline generally how what we are trying to do might be achieved using Restkit, if it is possible to do so.

来源:https://stackoverflow.com/questions/24042417/time-based-sync-with-restkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!