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 anyNSString
of JSON, once the library has been added to your project, and returns anNSArray
orNSDictionary
based on that JSON.-JSONRepresentation
called on anNSArray
orNSDictionary
returns the JSON-string representation of that object...really straightforward.
For more information, please see my examples in this duplicate question's answer.
精彩评论