I am currently making a Facebook application for iOS that pulls the profile feed and puts it in a UITableView.
现在 当观点定位时:
[facebook requestWithGraphPath:@"me/feed" andDelegate:self];
以及(避免)要求:FBRequest* request 确实是Load (id)result, i)
NSArray *messagesFBData = [result objectForKey:@"data"];
NSMutableArray *friendIds = [NSMutableArray arrayWithCapacity:messagesFBData.count];
NSMutableArray *fromData = [NSMutableArray arrayWithCapacity:messagesFBData.count];
NSMutableArray *imagesLocal = [NSMutableArray arrayWithCapacity:messagesFBData.count];
for (int x = 0; x < messagesFBData.count; x++) {
if ([(NSDictionary *)[messagesFBData objectAtIndex:x] objectForKey:@"message"] != nil) {
[friendIds addObject:[((NSDictionary*)[messagesFBData objectAtIndex:x]) objectForKey:@"message"]];
NSLog(@"loop Log: %@", [(NSDictionary *)[messagesFBData objectAtIndex:x] objectForKey:@"message"]);
[fromData addObject:[((NSDictionary*)[messagesFBData objectAtIndex:x]) objectForKey:@"from"]];
NSLog(@"%@", [((NSDictionary*)[messagesFBData objectAtIndex:x]) objectForKey:@"from"] );
NSDictionary *fromDataDictionary = [fromData objectAtIndex:x];
[imagesLocal addObject:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", [fromDataDictionary objectForKey:@"id"]]]]]];
NSLog(@"facebook ID: %@", [fromDataDictionary objectForKey:@"id"]);
} else
{
NSLog(@"Nil Called");
}
}
// don t forget to call loadData for your tableView
messages = friendIds;
images = imagesLocal;
NSLog(@"Equalized");
self.facebookTableView.delegate = self;
NSLog(@"Delegate Set");
[facebookTableView reloadData];
图像是全球阵容,因此可以进入——(可调用的电文*) 观点小组 ForRowAtIndexPath:NSIndexPath *)indexPath。
缩略语 观点小组 ForRowAtIndexPath:NSIndexPath *)indexPath, i have:
NSLog(@"Cell For Row Called");
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:@"messageCell"];
NSString *story = [messages objectAtIndex:indexPath.row];
cell.textLabel.text = story;
UIImage *image = [images objectAtIndex:indexPath.row];
cell.imageView.image = image;
cell.alpha = 1;
return cell;
因此,我的问题是,一个用户在墙上播下照片或录像时,怎么办? 我想在表象中显示形象/形象。 现在,它只是坠毁。 任何帮助都将受到高度赞赏。
Thanks, Virindh Borra