ios - JSON parsing is not working -
im trying parse , show json content in tableviewcell, goes wrong.
json here: http://bumpee.net/xcode/index.php
-(void)connectiondidfinishloading:(nsurlconnection *)connection { nsdictionary *json = [nsjsonserialization jsonobjectwithdata:webdata options:0 error:nil]; nsarray *arr = [json objectforkey:@"feed"]; for(nsdictionary *aaa in arr) { nsdictionary *one = [aaa objectforkey:@"1"]; nsstring *oneprint= [one objectforkey:@"name"]; [array addobject:oneprint]; } [[self tableview ] reloaddata]; }
the problem arr
nsdictionary
not nsarray
, when iterate on with
for (nsdictionary *aaa in arr) [...]
you go through nsstring
keys, , not values.
Comments
Post a Comment