这里滚动2 3次完全向上和向下的tableview添加图像到所有单元格。下面是代码重复的UItableViewCell,UITableView的行
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
HomeCell *cell = (HomeCell *) [tableView dequeueReusableCellWithIdentifier:@"HomeCell"];
if (cell == nil) {
cell = [[HomeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HomeCell"] ;
}
VenueDC *venueObj = [subSubCategoriesArray objectAtIndex:indexPath.row];
cell.lblName.text = venueObj.name;
if ([venueObj.imagesArray count] > 0) {
[cell.ivVenue setImage:venueObj.ivVenue];
[cell.ivVenue setHidden:NO];
cell.lblName.frame = CGRectMake(80, cell.lblName.frame.origin.y, 200, cell.lblName.frame.size.height);
}
venueObj = nil;
return cell;
}
什么这里发生的任何爱迪尔,图像仅在一个对象,第一次加载它显示了图像中的一个单元,但滚动后,对其他细胞也
试试这个回答,可能会对你有帮助。 :http://stackoverflow.com/questions/10535637/reusablecellwithidentifier-issue-in-cellforrowatindexpath/10535788#10535788 – superGokuN