Jump to content

Parse JSON in Objective-C?


Go to solution Solved by AnotherLurker,

2 posts in this topic

Recommended Posts

Posted

Hello, as some of you may know I am trying to turn my IG exploits into a reality, but I am having trouble with parsing/returning JSON from a URL response. Here is an example

 

 

lets say I submit this to a server

firstname=first&lastname=last&age=99

and the response from the server is this

{  
   "person":{  
      "firstname":"first",
      "lastname":"last",
      "info":{  
         "age":"99"
      }
   }
}

how would I retrieve this information (certain elements)

 

lets say I JUST want the persons age so the return string should be just "99"

or how do I JUST return the lastname or JUST the firstname, another thing how would I pass the returned element into the next POST request without the user having to type it again?

 

if anyone can find an example that would be fantastic :)

 

Thank You!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines