views:

708

answers:

3

Hi,

I fetch a JSON array from a web service with touchJSON. Which looks like this:

[{"icecream": {"title": "Banana"}}, {"icecream": {"title": "Strawberry"}}]

I'm not able to parse this into a NSDictionary, because touchJSON doesn't support JSON arrays.

How do I get my JSON array into a NSDicitionary?

Regards

+3  A: 

Have you consider trying another framework? This one seems to support JSON arrays.

pgb
Thanks. json-framework FTW.
Stefan
+1  A: 

Maybe you could use another of the many JSON implementations listed on the JSON homepage.

lothar
+1  A: 

You can chekc out the JSON webpage, where they provide links to parsing code in dozens of languages. However, at first glance it looks like you're trying to munge from one type of object (the JSON Array) into another that might not be able to capture all the relationships (the NSDictionary). Full disclaimer: I've never used an NSDictionary before.

Ben Mathes
No I just want to extract some values. In order to achieve this, transforming to NSDictionary is a quick way.
Stefan