Search code examples
iosrestful-architecture

Developing RESTful clients on iOS


I am building an app on iOS and on Mac OS X that talks to a server using REST. The app is expected to store data fetched from the server in a local store (preferably in a SQLlite database). I understand using Core Data is a good option, but I am looking for an example of an app architecture that works on the basis of UI Views getting notified when the SQLlite database is updated as a result of a response from the server.

I have seen a talk for Android at Google I/O that addresses this type architecture in detail. Are there any similar talks/articles like this for iOS?


Solution

  • You're mixing quite some different things here.First you need an interface for your restufl API. Look at AFNetworking library to handle requests to the server and build your API handler. Then use an NSFetchResultController to listen to your core data being updated and do what you need accordingly in your views. NSFetchResultController is built to be used with a UITableView but you can use it in other situations if needed.