How to sync CoreData and a REST web service asynchronously and the same time properly propagate any REST errors into the UI

前端 未结 4 791
别跟我提以往
别跟我提以往 2020-12-07 07:03

Hey, I\'m working on the model layer for our app here.

Some of the requirements are like this:

  1. It should work on iPhone OS 3.0+.
  2. The source of
4条回答
  •  广开言路
    2020-12-07 07:15

    You should really take a look at RestKit (http://restkit.org) for this use case. It is designed to solve the problems of modeling and syncing remote JSON resources to a local Core Data backed cache. It supports an offline mode for working entirely from the cache when there is no network available. All syncing occurs on a background thread (network access, payload parsing, and managed object context merging) and there is a rich set of delegate methods so you can tell what is going on.

提交回复
热议问题