iPhone的JSON库 [英] JSON library for iPhone

查看:105
本文介绍了iPhone的JSON库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iPhone项目中使用JSON库. 我发现json-framework库是目前最受欢迎的库.可以在这里找到: http://code.google.com/p/json-framework/.

I want to use JSON library in my 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/.

还有其他建议吗?

推荐答案

设置JSON框架

此应用程序中使用的库是由Stig Brautaset编写的,并托管在code.google.com上.我已经在App Store的两个应用程序中使用了这个库,今天的星座运势,免费付费.这是一个很棒的图书馆,您不会出错.

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. 下载iPhone JSON框架

安装过程中有一些变体,最简单且最不容易出错的是将源文件直接复制到您的项目中.在本文所附的项目中,此操作已为您完成,但是,如果需要将框架添加到现有或将来的项目中,则会在此处显示.

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. 从下载中打开dmg文件.
  2. 将JSON文件夹拖放到Xcode项目的组和文件"中的类"组上.
  3. 选中将项目复制到目标组的文件夹中"选项.
  4. 您现在可以在源文件中使用 #import"JSON.h" .
  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项目下载–第1部分

为了使这篇文章的长度易于管理,我将仅显示与JSON,Flickr和整个应用程序流程最相关的代码,以及您熟悉的外围代码,您可以在以下位置浏览任何时候在项目源代码中.

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. 下载 iPhone,JSON和Flickr –第1部分 Xcode项目
  1. Download iPhone, JSON and Flickr – Part 1 Xcode project

来源: http://iosdevelopertips.com/networking /iphone-json-flickr-tutorial-part-1.html

更新后的答案

使用NSJSONSerialization类 https://developer.apple.com/documentation/foundation/jsonserialization

Use NSJSONSerialization Class https://developer.apple.com/documentation/foundation/jsonserialization

这篇关于iPhone的JSON库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆