Hey every one i am programming an iphone app to get google search results into my app ,,, i have used the JSON Class to get the result … when i parsed it in JSON Parser and store it in NSDictionary i got 3 keys :
- responseData
- responseDetails
- responseStatus
the important one is the first one responseData which is has the search results …
the problem that there is (i think) another key within responseData which is “results” which contains the urls and other stuffs which is the most important part for my app… how to access this one and put it into NSDictionary …..
this is the request :
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton
and to make things clear please consider to put that request into your browser and when you get the results copy it and put it in this website at the left side to see what the keys and other things:
http://json.parser.online.fr/
thnx
You could use JSON parser – SB Json to convert json string into ObjectiveC objects. Note that there are a number of JSON parsers available in ObjectiveC but I chose SB Json for it’s ease of usage. But according to some benchmarks JSONKit is faster than SBJson.
Once you have your json string use this like so –
Here’s what you would do if you needed to parse public timeline from Twitter as JSON.The same logic could be applied to your Google Search results. You need to carefully inspect your json structure that’s all…