- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.jpg", indexPath.row+1]];
cell.textLabel.text = [data objectAtIndex:indexPath.row];
cell.detailTextLabel.text = @"row subtitle";
return cell;
}
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.jpg", indexPath.row+1]];
cell.textLabel.text = [data objectAtIndex:indexPath.row];
cell.detailTextLabel.text = @"row subtitle";
return cell;
}
UITableViewCellStyleDefault: 보충 설명이 없음
UITableViewCellStyleSubtitle: 보충 설명을 하위로 작게 표시
UITableViewCellStyleValue1: 상세 텍스트를 파란색으로 셀의 오른쪽에 배치
UITableViewCellStyleValue2: 상세 텍스트를 파란색으로 셀의 왼쪽에 배치
UIImageView * imageView: 이미지 뷰
UILabel * textLabel: 셀의 텍스트 레이블
UILabel * detailTextLabel: 셀의 보충 설명
UIView *accessoryView: 셀의 엑세서리
