4

我需要在我的应用程序中实现基本的 RESTful 功能,例如 post/get/delete + json 解析。

您建议将什么用作框架:

1) Resty http://projects.lukeredpath.co.uk/resty/ (ARC?) 2) http://restkit.org/ (ARC?)

他们每个人的优势是什么?

我问的原因是因为昨天我使用 ASIHTTPRequest 实现了一些 RESTful 功能,但今天我阅读的内容不再受支持:(

还有一件事,我听说 iOS5 SDK(GCD Dispatcher 或类似的东西)中有内置 JSON 支持,它适用于 iOS4 客户端吗?(它是编译时依赖还是运行时依赖?),它可以发布/获取请求吗?

4

1 回答 1

5

Depends on your requirements.

If you just need some RESTful communication with a server then Resty isnt too bad (Though I never used it, it looks straightforward).

Restkit on the other hand is one powerful package because of 1 ultimate feature. Integration with core data. Restkit is able to parse Json responses, make them into objects and save these objects to core data with minimal coding out of the box. This makes it highly useful in case this is the type of functionality you are looking for.

I would encourage you to define the functionality you need and have a look at the frameworks. If it basic stuff, as you say, then one can argue that Restkit may be too powerful.

As for the inbuilt JSON parsing library, well it is way down the list in priority. These framework already includes a Json parser and they work pretty well. I would seriously consider the advantages before I go on to retrofit these packaged frameworks with a JSON parser of choice.

于 2012-05-10T12:37:33.563 回答