开发者

Parsing JSON in iOS [duplicate]

开发者 https://www.devze.com 2023-03-27 10:51 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: Using JSON in iOS How does one parse JSON response in iOS? I have found this tutorial, and followed it bu
This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Using JSON in iOS

How does one parse JSON response in iOS? I have found this tutorial, and followed it but don't understand the exact way to do this. So, can anyone please give me a perfect tutorial about the usi开发者_C百科ng JSON library.


Parsing JSON in iOS is very easy with the SBJson library, and a frequent question on SO.

Quickly though, there are only two methods you should need in the SBJson library, -JSONValue and -JSONRepresentation:

  • -JSONValue cane be called on any NSString of JSON, once the library has been added to your project, and returns an NSArray or NSDictionary based on that JSON.
  • -JSONRepresentation called on an NSArray or NSDictionary returns the JSON-string representation of that object...really straightforward.

For more information, please see my examples in this duplicate question's answer.

0

精彩评论

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