안녕 친구 내가 테이블보기를 스크롤 할 때이 이미지가 하나 하나 오는 표는 10 세포UIITabelViewCell 잘못 표시되는 이미지 테이블 셀에 내가 이미지를 표시하고
을 가지고 있지만 난 두 세포
에 이미지를 표시하고 말한다 모든 셀
그래서 내가 여기서 잘못하고 있습니다.
정적 NSString * 식별자 = @ "CellTypeLabel";
// create custom cell
CustomizedTableCells* cell = nil;
if (cell == nil)
cell = [[[CustomizedTableCells alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
// cell accessory type
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.imageView.image = nil;
NyhtrAppDelegate *appDelegate = (NyhtrAppDelegate *)[[UIApplication sharedApplication] delegate];
NSXMLElement* node = [appDelegate.items objectAtIndex:indexPath.row];
NSLog(@"\n Output :: %@ :: ", [node XMLString]);
// set the lable name for a cell
if(node != NULL)
{
int width = cell.contentView.bounds.size.width-50;
if([[[node elementForName:@"pubDate"] stringValue]length] > 0)
[cell setCellWithTitleAndSize:[[node elementForName:@"title"] stringValue] rect:CGRectMake(45, 0, width, 35) size: 17];
else
[cell setCellWithTitleAndSize:@"N/A" rect:CGRectMake(45, 0, width, 35) size: 17];
}
NSXMLElement* iconElement = [self getIconElementForThisDomain:[self getDomain:node]];
NSString* iconImageUrl = nil;
if (nil != iconElement)
iconImageUrl = [[iconElement elementForName:@"retina-icon"]stringValue];
else
iconImageUrl = @"http://nyhtr.se/icon/nyheter24.png";
// cached images
NSString* imageName = [[UICachedImageMgr defaultMgr] imageNameFromURLString:iconImageUrl];
UIImageProxy* imageProxy = [UICachedImageMgr imageWithName:imageName userInfo:self];
cell.imageView.image = imageProxy.image;
return cell;
잘못된 (가능성이 큰) cellForRowAtIndexPath : 메서드가 있습니다. 실수로 코드를 볼 기회가 있습니까? – Vladimir
질문 편집 및 코드 삽입 ...이 코드에서 이미지를 셀에 설정하는 위치는 어디입니까? – Vladimir
@Vladimir 코드 –