Possible Duplicate:
News Feed Response parsing in iphone using Facebook Graph Api
I'm currently trying to access the posts in a user's newsfeed. So what I did, in my -viewDidLoad
I placed this call [self.facebook requestWithGraphPath:@"me/home" andDelegate:self]
.
To check if this request is working fine, I NSLog
ged inside the method - (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response
that I receive a response.
Consequently, inside the method - (void)request:(FBRequest *)request didLoad:(id)result
I NSLog
ged the result
f. By doing a further check what is the result
I'm getting, I confirmed that this is in a Dictionary
which contains an Array
of Dictionaries
. Correct me if I'm wrong but it seems that this is a JSON data.
Enlighten me as to how can I parse this. I wish to access the post's messages contents and have a tableView filled up with those contents.
Below are some parts of the result
's contents. Intended to cut the contents because the JSON data is very long.
actions = ( { link = "http://www.facebook.com/1281439485/posts/3530285457443"; name = Comment; }, { link = "http://www.facebook.com/1281439485/posts/3530285457443"; name = Like; } ); application = { id = 312323298863842; name = Visitors; namespace = "pdf_balkyh"; }; comments = { count = 0; };"created_time" = "2012-07-23T05:24:22+0000"; description = "Check here--->>>>>>> FA\U0152BOOK PROFILE VIEWER \U00ae <<<<<<<<<------"; from = { id = 1281439485; name = "Ruje Anne Granada"; }; icon = "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif"; id = "1281439485_3530285457443"; likes = { count = 2; data = ( { id = 100001286433192; name = "Lea Jean Nasis"; }, { id = 100001689591913; name = "Donna Mae Mata Severino"; } ); }; link = "http://www.facebook.com/photo.php?fbid=444944958870260&set=at.444944952203594.105123.100000642787491.1281439485&type=1&relevant_count=1";"object_id" = 444944958870260; picture = "http://photos-g.ak.fbcdn.net/hphotos-ak-snc7/487763_444944958870260_1869491222_s.jpg"; story = "Ruje Anne Granada was tagged in Dominik Espedido's photo.";"story_tags" = { 0 = ( { id = 1281439485; length = 17; name = "Ruje Anne Granada"; offset = 0; type = user; } ); 32 = ( { id = 100000642787491; length = 16; name = "Dominik Espedido"; offset = 32; type = user; } ); }; type = photo;"updated_time" = "2012-07-23T05:24:22+0000"; }, { actions = ( { link = "http://www.facebook.com/1653195989/posts/3973684834542"; name = Comment; }, { link = "http://www.facebook.com/1653195989/posts/3973684834542"; name = Like; } ); comments = { count = 0; };"created_time" = "2012-07-23T05:22:27+0000"; from = { id = 1653195989; name = "Moisheil Shawnaleh Casin"; }; id = "1653195989_3973684834542"; likes = { count = 5; data = ( { id = 1188264972; name = "Fatima Mariz Siapco Ballon"; }, { id = 100000082876900; name = "Charisskayne Cudilla"; }, { id = 100000278413364; name = "Ser Jerido Mendoza"; }, { id = 100000510643459; name = "Joselito Delacruz"; } ); }; message = "Time to face the book. Goodnight Facebook :*"; type = status;"updated_time" = "2012-07-23T05:22:27+0000"; }, { actions = ( { link = "http://www.facebook.com/753114045/posts/10151290447744046"; name = Comment; }, { link = "http://www.facebook.com/753114045/posts/10151290447744046"; name = Like; } ); comments = { count = 5; data = ( {"created_time" = "2012-07-23T06:10:14+0000"; from = { id = 664040284; name = "Karla Zulueta"; }; id = "753114045_10151290447744046_27243728"; likes = 1; message = "nice seeing you master jedi! "; }, {"created_time" = "2012-07-23T06:52:06+0000"; from = { id = 605194601; name = "Punky Taguines"; }; id = "753114045_10151290447744046_27243977"; message = "awww!!! =)"; } ); };"created_time" = "2012-07-23T05:15:08+0000"; from = { id = 753114045; name = "Al Hiquiana"; }; id = "753114045_10151290447744046"; likes = { count = 29; data = ( { id = 1799103505; name = "Hans Soriano"; }, { id = 1285932568; name = "Dean Edward Mejos"; }, { id = 613326737; name = "Kathleen Lois Tolentino"; }, { id = 562689505; name = "Miguel Valeroso"; }, { id = 590597501; name = "Juan M. Borra III"; } ); }; message = "Is today a \"Look There's Dr. Hiquiana Let's Greet Him Day\"? Walking across Pearl, a huge SUV pulls over and out comes Samantha Maristela, Karla Zulueta, and Mia Penaflor to greet me, and two minutes later while crossing over Amethyst, my niece Camille Hiquiana pulls her car over and greets her uncle. Next time, please let me know what time you want me to come out to Pearl so that you can all pull your cars along the street and greet me at the same time okay? Don't wanna get blamed for traffic delays. :)";"message_tags" = { 118 = ( { id = 728750295; length = 18; name = "Samantha Maristela"; offset = 118; type = user; } ); 138 = ( { id = 664040284; length = 13; name = "Karla Zulueta"; offset = 138; type = user; } ); 244 = ( { id = 550729297; length = 16; name = "Camille Hiquiana"; offset = 244; type = user; } ); }; to = { data = ( { id = 728750295; name = "Samantha Maristela"; }, { id = 664040284; name = "Karla Zulueta"; }, { id = 550729297; name = "Camille Hiquiana"; } ); }; type = status;"updated_time" = "2012-07-23T06:52:06+0000"; }, { actions = ( { link = "http://www.facebook.com/1513598830/posts/4307072084362"; name = Comment; }, { link = "http://www.facebook.com/1513598830/posts/4307072084362"; name = Like; } ); application = { id = 2915120374; name = Mobile; }; comments = { count = 1; data = ( {"created_time" = "2012-07-23T04:49:22+0000"; from = { id = 1513598830; name = "Lhuzie Fherr Imba"; }; id = "1513598830_4307072084362_4645870"; likes = 1; message = "hehehe liked agd kua?! lol"; } ); };"created_time" = "2012-07-23T04:45:22+0000"; from = { id = 1513598830; name = "Lhuzie Fherr Imba"; }; id = "1513598830_4307072084362"; likes = { count = 3; data = ( { id = 100000163093708; name = "Joezell Lance"; }, { id = 100000168291972; name = "Maya Imba"; }, { id = 1269626082; name = "Jade Siquig"; } ); }; message = "i wanna live in your world ..\n:)"; type = status;"updated_time" = "2012-07-23T04:49:22+0000"; }, { actions = ( { link = "http://www.facebook.com/144392208916916/posts/443652415657559"; name = Comment; }, { link = "http://www.facebook.com/144392208916916/posts/443652415657559"; name = Like; } ); comments = { count = 15; data = ( {"created_time" = "2012-07-23T06:32:30+0000"; from = { id = 100000965461049; name = "Marvin Corpuz Nueva Espana"; }; id = "144392208916916_443652415657559_1142915"; message = "wow scrape"; }, {"created_time" = "2012-07-23T06:48:05+0000"; from = { id = 100001181620235; name = "Acist Aj Kulits"; }; id = "144392208916916_443652415657559_1142944"; message = "LIKE SANA ASO nalang wahahhahaha LOSO"; } ); };"created_time" = "2012-07-23T04:44:02+0000"; from = { category = "Public figure"; id = 144392208916916; name = "Steelwolves Guild (cabal online ph.)"; }; icon = "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif"; id = "144392208916916_443652415657559"; likes = { count = 19; data = ( { id = 100001313573878; name = "Rigel ANthony"; }, { id = 100001029619613; name = "Micheal Dohinog"; }, { id = 100001189865269; name = "Vicente Tapdasan Aparri"; }, { id = 100000579428324; name = "Souljaboy RosaLes"; } ); }; link = "http://www.facebook.com/photo.php?fbid=443652395657561&set=a.144534268902710.19465.144392208916916&type=1&relevant_count=1"; message = "oi! doggy ano yan!!\n~xJaxs";"object_id" = 443652395657561; picture = "http://photos-h.ak.fbcdn.net/hphotos-ak-snc6/602592_443652395657561_2117800715_s.jpg"; shares = { count = 2; }; type = photo;"updated_time" = "2012-07-23T06:48:05+0000"; } );