-1

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.

Community
  • 1
  • 1
Solid Soft
  • 1,872
  • 2
  • 25
  • 55
  • Also [iPhone/iOS JSON Parsing Tutorial](http://stackoverflow.com/questions/5813077/iphone-ios-json-parsing-tutorial), [Comparison of JSON Parser](http://stackoverflow.com/questions/2256625/), [Parse JSON in iPhone](http://stackoverflow.com/questions/6992487/), and [many more](http://stackoverflow.com/search?q=%5Bios%5D+%5Bjson%5D+tutorial). – jscs Aug 09 '11 at 19:58

1 Answers1

0

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.

Community
  • 1
  • 1
GarlicFries
  • 8,095
  • 5
  • 36
  • 53
  • thanks GarlicFries.. your answer works.. Can you explain me about this negative reputation on Stackoverflow question..? – Solid Soft Aug 10 '11 at 04:41
  • 1
    While I did not do so, your question was likely downvoted because it is a duplicate of many other questions on StackOverflow. It's important to have a look around and see if other people have already asked what you are about to ask before you do so, as asking duplicate questions is also just asking for a downvote. – GarlicFries Aug 10 '11 at 10:26