为什么在滚动我的tabelview单元格时会出现相同的图像?

时间:2016-07-08 04:54:45

标签: ios objective-c uiimageview uiimage

NSString *url = [NSString stringWithFormat:@"%@",[enclosureUrlArray objectAtIndex:indexPath.row]];
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
        NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
        ([self.tableView cellForRowAtIndexPath:indexPath]);
        dispatch_async(dispatch_get_main_queue(), ^{
            cell.tag = indexPath.row;
            UIImage *image = [UIImage imageWithData:imageData];
            cell.IMGLabel.image = image;
            [cell.IMGLabel setImage:image];
            [cell.IMGLabel.layer setMasksToBounds:YES];
            [cell.IMGLabel.layer setCornerRadius:2.5f];
            [cell setNeedsLayout];


        });
    });

0 个答案:

没有答案