views:

1341

answers:

2

I have a web site with an API which publishes the information using JSON. I can access this API fine, but I would really like to store the information in an iPhone application using Core Data. Is there a way to hook the Persistent Store to the JSON API so rather than having to keep them in sync using some algorithm I can just use the web site as the back end for Core Data.

I hope that is clear.

+3  A: 

No, you can only use XML, SQLite, or an in-memory store.

Ben Alpert
He's building an iPhone app, only the SQLite back end is available. XML is desktop-only right now (and probably forever).
Frank Szczerba
+3  A: 

If you just want to use Core Data for its object graph management facilities, you can parse the JSON data and create an object graph associated with an in memory store.

If you want to persist this data in a serialized JSON format, Core Data does have the facility for creating new atomic store types. You could write a JSON store as an alternative to the XML store format.

Jim Correia