JSON library for iPhone
I want to use JSON library in my开发者_JS百科 iPhone project. I've found that the json-framework library is the most popular at the moment. It can be found here: http://code.google.com/p/json-framework/.
any other suggestions?
Setting up JSON Framework
The library used in this application is one written by Stig Brautaset and hosted at code.google.com. I’ve used this library in two applications that are in the App Store, Today’s Horoscope, free and paid. This is an excellent library, you can’t go wrong.
- Download the iPhone JSON framework
There are a few variations on the install process, the easiest and least prone to errors is to copy the source files directly into your project. In the project that is attached to this post, this is done for you, however, it’s shown here if you need to add the framework to an existing or future project.
Xcode Project Download – Part 1
- Open the dmg file from the download.
- Drag the JSON folder and drop it on the ‘Classes’ group in the ‘Groups & Files’ in your Xcode project.
- Check the “Copy items into destination group’s folder” option.
- You can now use #import “JSON.h” in your source files.
To keep this post to a manageable length, I’ll show only the code that is most pertinent to JSON, Flickr and the overall application flow, the code on the periphery you’ll be familiar with and you can browse through at any time in the project source code.
- Download iPhone, JSON and Flickr – Part 1 Xcode project
Source: http://iosdevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html
Updated Answer
Use NSJSONSerialization Class https://developer.apple.com/documentation/foundation/jsonserialization
Here's the documentation on installing json-framework.
I like JSONKit myself, it's simple and fast.
精彩评论