2013-10-18 121 views
2

我正在越來越json格式,但事情是我想檢索專輯圖像一個接一個,並顯示它在網格視圖中...請任何人提出了一些代碼或想法... PL建議我怎麼去相冊ID爲專輯如何檢索專輯圖像從facebook使用圖形api-ios

Results: { 
     data =  (
     { 
    "can_upload" = 1; 
    count = 2; 
    "cover_photo" = 1404379296458611; 
    "created_time" = "2013-10-04T11:35:21+0000"; 
    from =    { 
     id = 100006596624401; 
     name = "sample"; 
    }; 
    id = 1404366983126509; 
    link = "https://www.facebook.com/album.php?fbid=1404366983126509&id=100006596624401&aid=1073741827"; 
    name = "Photos"; 
    privacy = custom; 
    type = app; 
    "updated_time" = "2013-10-09T07:41:48+0000"; 
}, 
     { 
    "can_upload" = 0; 
    "created_time" = "2013-10-08T10:55:52+0000"; 
    from =    { 
     id = 100006596624401; 
     name = "sample"; 
    }; 
    id = 1406014439628430; 
    link = "https://www.facebook.com/album.php?fbid=1406014439628430&id=100006596624401&aid=1073741829"; 
    name = "he Photos"; 
    privacy = custom; 
    type = app; 
    "updated_time" = "2013-10-08T11:33:49+0000"; 
}, 
     { 
    "can_upload" = 0; 
    count = 1; 
    "cover_photo" = 1405547679675106; 
    "created_time" = "2013-10-07T06:21:36+0000"; 
    from =    { 
     id = 100006596624401; 
     name = "sample"; 
    }; 
    id = 1405547666341774; 
    link = "https://www.facebook.com/album.php?fbid=1405547666341774&id=100006596624401&aid=1073741828"; 
    name = test; 
    privacy = everyone; 
    type = normal; 
    "updated_time" = "2013-10-07T06:21:47+0000"; 
}, 
     { 
    "can_upload" = 0; 
    "created_time" = "2013-09-25T05:30:31+0000"; 
    from =    { 
     id = 100006596624401; 
     name = "sample"; 
    }; 
    id = 1399900213573186; 
    link = "https://www.facebook.com/album.php?fbid=1399900213573186&id=100006596624401&aid=1073741825"; 
    name = "iOS Photos"; 
    privacy = everyone; 
    type = app; 
    "updated_time" = "2013-09-25T06:26:13+0000"; 
} 
); 
paging =  { 
    cursors =   { 
    after = "MTM5OTkwMDIxMzU3MzE4Ng=="; 
    before = "MTQwNDM2Njk4MzEyNjUwOQ=="; 
}; 
    }; 
+0

你怎麼能得到這張專輯的ID?應用程序是否必須通過Facebook進行審覈? – chetu

回答

3

每個照片試試這個

FbGraphResponse *fb_graph_response = [fbGraph doGraphGet:@"me/albums" withGetVars:nil]; 
    NSDictionary *albums = (NSDictionary *)[fb_graph_response.htmlResponse JSONValue]; 
    NSMutableArray * albumids = [[NSMutableArray alloc] init]; 
    albumids = [albums objectForKey:@"data"]; 

    for(int i =0; i< [albumids count]; i++) 
    { 
     NSDictionary *dictuser = (NSDictionary *)[albumids objectAtIndex:i]; 
     [album addObject:[dictuser objectForKey:@"id"]]; 
     [albumname addObject:[dictuser objectForKey:@"name"]]; 
    } 
+0

謝謝你讓你知道 – SODC

+0

fbgraphresponse哪個框架可以用你告訴我我正在使用facebooksdk框架 – SODC

+0

這是FBGraph Api – Tendulkar

相關問題