objective c - iOS returns "null" data from JSON feed -


i downloading , parsing json feed in ios application. parts of data json feed provides shown correctly in ios application, parts of json feed seem return "null" though in actual json feed itself, not contain data "null".

here code:

nserror *myerror = nil; nsdictionary *res = [nsjsonserialization jsonobjectwithdata:responsedata options:nsjsonreadingmutableleaves  error:&myerror]; nsarray *results = [res objectforkey:@"current_observation"]; nsarray *cur = [results valueforkey:@"weather"]; nsarray *loc = [results valueforkey:@"full"]; nsarray *tmp = [results valueforkey:tmptype]; 

the json feed trying load one: http://api.wunderground.com/api/595007cb79ada1b1/conditions/q/ca/san_francisco.json

one part of json feed returns "null" is:

"full":"san francisco, ca" 

the above returns "null".... why? , how go fixing issue?

thanks, dan

you need

nsstring *full= [[results valueforkey:@"display_location"] valueforkey:@"full"]]; 

because nested json.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -