iphonethree20

Three20 + JSON Parsing


I'm using Three20 and want to use JSON to populate my TTPhotoViewController.

If I go to a web address, let's say,

www.bbc.com/jsonoutput

I get the following

{"name":"MyName","curNiceDate":"Wed 29 Dec 10","images":["UK\/2010\/12\/29\/1.jpg","US\/2010\/12\/29\/2.jpg","EU``\/2010\/12\/29\/3.jpg","FR\/2010\/12\/29\/4.jpg","FR\/2010\/12\/29\/5.jpg","FR\/2010\/12\/29\/6.jpg","FR\/2010\/12\/29\/7.jpg","FR\/2010\/12\/29\/8.jpg","FR\/2010\/12\/29\/9.jpg"]}

I want to pick out images which are in www.bbc.com/images/.

All those directories are locations of images relevant from the above address. How would I go about pulling out this information from the JSON output and make it into a URL which will look like this

www.bbc.com/UK/2010/12/29/1.jpg

www.bbc.com/US/2010/12/29/2.jpg

www.bbc.com/EU/2010/12/29/3.jpg

www.bbc.com/FR/2010/12/29/4.jpg

So I can feed it into the TTPhotoView Picker.

Any help please?


Solution

  • https://github.com/stig/json-framework It's super easy to use. If you get stuck just look at how I used it in my code here