views:

72

answers:

1

I'm using json-framework to parse some simple json in my iphone app, and it works fine. But now I'm needing to parse the json from google's reverse geo-coder which is very complex and really big. The json output can be seen here: http://maps.google.com/maps/geo?q=40.714224,-73.961452&output=json&sensor=true_or_false

I'm trying to get the "AdministrativeAreaName", "LocalityName", and the "CountryNameCode" out of it but can't even think about how to do it. I know the JSON itself is an NSDictionary with other NSDictionaries and arrays in it but I can't seem to figure this out. Can someone give me some pointers or maybe some example code on how I would parse json this complex using json-framework? Thanks so much, any help is appreciated!!

+1  A: 

Did you consider asking for a CSV response instead?

http://maps.google.com/maps/geo?q=40.714224,-73.961452&output=csv&sensor=false

It's a little simpler. :-)

Marcelo.

Marcelo
Oh my. You are god. And now I feel a little dumb, thanks so much!!
Alexander
Now, I have to ask though is there a way to just get the city and state name out of this response?
Alexander
I know nothing about the iPhone or the language you code it with, but since it is CSV, (comma separated values), you should have a way to split the string at the commas into an array. Just make sure you try a few different locations, (like middle of the sea), to ensure you cover all possible responses.
Marcelo