iphone - How to get Facebook Photo Albums for iOS? -
i'm making following simple request facebook. goal grab names of user's photo albums:
[[appdelegate shareddelegate].facebook requestwithgraphpath:@"me/albums" anddelegate:[appdelegate shareddelegate]]; then, json response server such:
data = ( { "can_upload" = 1; count = 4; "cover_photo" = 321491374598618; "created_time" = "2012-06-04t21:46:23+0000"; = { id = 100002132746588; name = "owner...."; }; id = 321491371265285; link = "http://www.facebook.com/album.php?fbid=321491371265285&id=100002132746588&aid=73680"; name = "photos"; privacy = custom; type = normal; "updated_time" = "2012-06-04t22:08:39+0000"; }, { "can_upload" = 0; count = 1; "cover_photo" = 318401854907570; "created_time" = "2012-05-31t00:00:35+0000"; description = "which friend stalks most?"; = { id = 100002132746588; name = "owner...."; }; id = 318401848240904; link = "http://www.facebook.com/album.php?fbid=318401848240904&id=100002132746588&aid=73163"; name = "which friend stalks most?"; privacy = friends; type = normal; "updated_time" = "2012-05-31t00:00:36+0000"; }, and on. problem is, when try parse data with:
nslog(@"%@", [result objectforkey:@"name"]); i null. assume happening because nsdictionary data returned in not know name entry concentrate on. how parse data names of all albums?
"result" array of dictionaries, loop through array , grab name each element in array.
for (nsdictionary *analbum in [result objectforkey:@"data"]) { nslog(@"%@", [analbum objectforkey:@"name"]); }
Comments
Post a Comment