开发者

JSON library for iPhone

开发者 https://www.devze.com 2023-02-11 10:53 出处:网络
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-framewo

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.

  1. 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.

  1. Open the dmg file from the download.
  2. Drag the JSON folder and drop it on the ‘Classes’ group in the ‘Groups & Files’ in your Xcode project.
  3. Check the “Copy items into destination group’s folder” option.
  4. You can now use #import “JSON.h” in your source files.
Xcode Project Download – Part 1

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.

  1. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消