UITableView照片在Graph API中多次显示

现在我正在制作Facebook的iPad应用程序。 我拉着墙,把它放到一个UITableView。 我把照片放入tableview的方式是这样的:

在requestDidLoad中查询图像数组。

-(void)request:(FBRequest *)request didLoad:(id)result { //Determine if result is a array of images if ([result objectForKey:@"images"] != nil) { if ([request.url rangeOfString: @"=images"].location != NSNotFound) { realPicsonWall = result; NSLog(@"Result Object: %@", [result objectForKey:@"images"]); } } 

然后在cellForRowAtIndexPath中:

  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"messageCell"]; imageCellData *imageCell = [tableView dequeueReusableCellWithIdentifier:@"imageCell"]; //imageCellData is custom cell. if ([[objectTypes objectAtIndex:indexPath.row] isEqualToString:@"photo"]) { //this is a picture NSArray *imagesArray = [realPicsonWall objectForKey:@"images"]; NSDictionary *imageProps = [imagesArray objectAtIndex:3]; NSLog(@"imageprops source: %@", [imageProps objectForKey:@"source"]); [imageCell.imageview setImageWithURL:[NSURL URLWithString:[imageProps objectForKey:@"source"]]]; [imageCell layoutSubviews]; return imageCell; }else if ([[objectTypes objectAtIndex:indexPath.row] isEqualToString:@"video"]) { //this is a video NSLog(@"Video Called"); NSDictionary *fromDictionary = [globalWhoPosted objectAtIndex:indexPath.row]; cell.textLabel.text = @"Videos Are Not Supported"; cell.detailTextLabel.text = [NSString stringWithFormat:@"Video Posted By: %@", [fromDictionary objectForKey:@"name"]]; NSLog(@"Video By: %@", [fromDictionary objectForKey:@"name"]); return cell; } else { NSDictionary *fromDictionary = [globalWhoPosted objectAtIndex:indexPath.row]; NSString *story = [messages objectAtIndex:indexPath.row]; cell.textLabel.text = story; cell.detailTextLabel.text = [NSString stringWithFormat:@"By: %@", [fromDictionary objectForKey:@"name"]]; cell.alpha = 1; return cell; } return cell; } 

在numberOfRows:

 { return [messages count]; } 

在墙上有两个不同的图像我拉,但它拉2相同的图像,所以在tableview我看到相同的图像2次,而它应该是2差。 图片。 任何帮助都会很慷慨。 谢谢。

你有一个这样的情况下,一个graphapiurl的例子? 也许我会做的是寻找所有具有相同尺寸的图像。 这将导致这样的假设:如果json中有多个图像,而不是仅仅是不同的分辨率,那么如果抓取具有相同分辨率的图像,则将保证抓取那些独特的图像。