Q:

Facebook Help, iOS SDK

I am currently making a Facebook iOS Application and In the app I am trying to get the users Facebook wall and put it in a UITable View. 
So Far I Have:
[facebook requestWithGraphPath:@"me/home" andDelegate:self];

This is called when the view is loaded.
The in Facebook Did Receive Response, I want To Populate the table view with the posts, but this is where I have trouble. I looked everywhere for an answer and I read the apple and Facebook documentation, and they didn't help me in my case. Also If Someone Posts a Video or Image, How Would I Handle That in a TableView?? Any Help would be greatly appreciated.
Thanks,
Virindh Borra

A:

You need to take the response and put it into an NSArray.  Then in your UITableViewDelegate methods load up the cell:
-(void)request:(FBRequest *)request didLoad:(id)result {
   // take my result and put it into an array, usually it's an NSDictionary
    NSArray *friendsFBData = [result objectForKey:@"data"];
    NSMutableArray *friendIds = [NSMutableArray arrayWithCapacity:friendsFBData.count];
    for (int x = 0; x < friendsFBData.count; x++) {
        [friendIds addObject:[((NSDictionary*)[friendsFBData objectAtIndex:x]) objectForKey:@"id"]];
    }

   // don't forget to call loadData for your tableView
   [self reloadData];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // Grab data from array
    NSString *myName = [myArray objectAtIndex:indexPath.row];
    [myLabel setText:myName];
}

