I'm iOS very fresh beginner..
I'm trying to build REST app that gets and updates data from/to some server (by http get and post requests using JSON data format).
I need to have some local saving mechanism (like Core Data) so that app can be used offline, but as soon as network is available it has to be synced (sent, refreshed) with server.
There will be lots of different requests on server, so there could be a lot of networking & json parsing code. I would like to avoid having viewController classes overloaded with lots of json parsing code.
My question is - what is the best practice on iOS to accomplish this?
Should I have one apiCommunicator with all requests (using NSUrlConnection) (and use delegating ui-updates to viewController that has requested data)?
Or should I have api calls in different classes (one per one model class)?
What is standard approach?
Can you at least point me to some readings or sample projects where I can learn more about.
If possible, I would like to see/read some solution without using 3rd apis, since I'm already overloaded with lot's of new stuff within iOS itself :)
Aucun commentaire:
Enregistrer un commentaire