I'm kinda lost here and I would appreciate if someone would clear things.. My need is to synchronize the content in my app with the content on the server and I have a working Core Data model.
I understand the following:
-The best way to synchronize data on the web with an iPhone is using JSON.
-CoreData needs to be translated to-from JSON because CoreData don't speak web.
-Its not complicated to translate myself with this example but lidenbrock is a library for translating coreData to-from JSON.
-RestKit is integrated with CoreData 开发者_运维问答and does the translation built-in.
-JSONKit is the fastest way to synchronize data
After that the question is should I use JSONKit + lidenbrock or use RestKit instead? any suggestions? did I miss something?
Thanks.
Restkit works like a charm and it is bundled with JSONKit.
"RestKit provides JSON parser implementations using JSONKit, SBJSON & YAJL. The recommended parser is JSONKit (as it is known to be the fastest JSON implementation available), but you may choose whatever parser you like and they can be changed at runtime."
But Restkit does more than translating objects, it actually maps RESTful requests to actions in your Model, thus abstracting all the data handling needed after a GET, POST, DELETE request to your backend.
I've been playing around with Restkit and to be honest i've found alot of it overwhelming - especially given the changes to the source and documentation which means most of the tutorials are not updated for Xcode 4 (so be careful if you are following tutorials on Restkit) - there is a great on on Restkit and github though.
If all you want to do is simple sync of data objects then I would suggest lidenbrock only if you have control over the end web service - as with lidenbrock it needs a 1 to 1 mapping with the db objects and the json (i.e field names need to match) - with Reskit field names do not need to match as you can customise and provide matching options.
I was originally using SBJSON framework but i've now switched to JSONKIT (alot quicker IMO)
utlimately though I would only use Reskit if you do not have control over the end web service
(one advantage of reskit is the relationship management though)
精彩评论