0

I have an application in which I am getting a response like this from a webservice. Can anybody tell me how to parse this to make it as individual strings"Info":

{
  "name":"gdgdgdgd",
  "desc":"Cosmopolitan life, adventurous outlook, 'been there done that' attitude, and yet the way the life ...",
  "address1":" 2nd A Main ",
  "address2":" Layout,"
},
1
  • 2
    Use NSJSONSerialization. Commented Jul 11, 2012 at 5:26

2 Answers 2

2

That's a JSON representation of an object.

In iOS 5, JSON classes we're added as NSJSONSerialization

Here's a tutorial:

http://www.raywenderlich.com/5492/working-with-json-in-ios-5

Here's another thread discussing other options as well like JSONKit, YAJL

Native JSON support in iOS?

Sign up to request clarification or add additional context in comments.

Comments

-1

do like this using json library

NSMutableDictionary *listd=[dict objectForKey:@"merchantInfo"];

if([listd isKindOfClass:[NSDictionary class]])

{

   stringshopname=[listd objectForKey:@"name"]; 
   stringshopdesc=[listd objectForKey:@"desc"];


}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.