Sto facendo la seguente semplice richiesta a Facebook. Il mio obiettivo è quello di prendere i nomi di tutti gli album di foto di un utente:Come ottenere gli album fotografici di Facebook per iOS?
[[AppDelegate sharedDelegate].facebook requestWithGraphPath:@"me/albums" andDelegate:[AppDelegate sharedDelegate]];
Poi, ottengo una risposta JSON dal server, come ad esempio:
data = (
{
"can_upload" = 1;
count = 4;
"cover_photo" = 321491374598618;
"created_time" = "2012-06-04T21:46:23+0000";
from = {
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 You the Most?";
from = {
id = 100002132746588;
name = "Owner....";
};
id = 318401848240904;
link = "http://www.facebook.com/album.php?fbid=318401848240904&id=100002132746588&aid=73163";
name = "Which Friend Stalks You the Most?";
privacy = friends;
type = normal;
"updated_time" = "2012-05-31T00:00:36+0000";
},
E così via. Il problema è che, quando si tenta di analizzare i dati con:
NSLog(@"%@", [result objectForKey:@"name"]);
ottengo null
. Presumo che ciò stia accadendo perché il NSDictionary
in cui i dati vengono restituiti non sa quale voce di name
concentrarsi su. Come analizzo i dati in modo da ottenere i nomi di tutti gli album?
Leggi la mia risposta potrebbe essere ottenere la soluzione ..... http: //stackoverflow.com/questions/30207465/ios-facebook-album-photos-picker/31789234#31789234 –