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 using JSON library.
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 using 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.