Reputation: 4339
I'm writing an iPhone app to display the location of items on Google Maps using MapKit. I have a set of items which are to be displayed on the map. These items can change over time so I'd like to manage them centrally on a webserver and allow the client to fetch it as new versions become available. There are a few ways I could do this and I'd like some input on my current ideas or suggestions for better alternatives.
Firstly, I want to use Core Data to store the items on the iPhone because I'm using this as a learning opportunity for Core Data as much as anything else. I would however like to hear thoughts on the server-side storage and formatting of the data for conversion by iOS to Core Data objects.
So, I'd like the solution to use Core Data on the phone, I understand NSXMLParser so I know how I can implement that solution really. I'd like to know if there are alternative ways of serving the data which reduces the amount of manipulation required to convert the server-side data to Core Data objects.
Upvotes: 1
Views: 355
Reputation: 16719
First the server side: I have no doubts the you have to store you data in a database, because it's very flexible (you can provide your client with miscellaneous requests, you can add/update/change tables in your DB, while the external side remains the same).
As for the format of data, that you're sending from the server, I think that this the question of your own preferences and the problem domain. I prefer XML, but this is me. You can read this very nice article JSON vs XML If you choose JSON, then i suggest you this very nice utility framework for parsing it: json-framework
But your client should not care about the format of data. You have to define the interface with the constructor like
-(id) initWithDictionary:(NSDictionary*) dict;
no matter where did you get that dictionary (after parsing XML/JSON or from DB or whatever).
Upvotes: 1