이 코드의 잘못된 점은 무엇입니까? 이미지가 표시되지 않습니다. 어떤 도움을 주시면 감사하겠습니다 ... 코드를 살펴보면 모든 변수가 올바르게 업데이트되었음을 알 수 있습니다. 코드는 오류없이 실행됩니다. 이미지는 보이지 않습니다.테이블 뷰 셀의 사용자 정의 이미지 뷰
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ModuleViewCellId = @"ModuleViewCellId";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ModuleViewCellId];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ModuleViewCellId] autorelease];
}
NSUInteger row = [indexPath row];
NSDictionary *step = [self.module.steps objectAtIndex:row];
cell.textLabel.text = [step objectForKey:kStepTitleKey];//;
cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.0];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.backgroundColor = [UIColor clearColor];
cell.indentationWidth = 50;
cell.indentationLevel = 1;
//2/6 shp - add icons to the table view
NSString *imagename = [step objectForKey:kStepIconKey];
NSLog(@"%@",imagename);
UIImageView *image;
image = [[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 57, 57)] autorelease];
image.tag = 1000 + row;
image.contentMode = UIViewContentModeScaleAspectFit;
image.hidden = FALSE;
[image setImage: [UIImage imageNamed:imagename]];
[cell.contentView addSubview:image];
return cell;
}