우리가 배열의 10 개 항목이있는 경우, 다음 각 indexPath.rowdequeueReusableCellWithIdentifier : 다른 indexPath를 어떻게 처리합니까?
내 질문 10 개 세포를 ALLOC합니다
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
static int count = 0;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
NSLog(@"count %d", count++);
}
// Configure the cell...
cell.textLabel.text = [array objectAtIndex:indexPath.row];
return cell;
}
우리의 tableview의 일부 표준 코드를 살펴 보자하는 기능 reuseIdentifier 어떻게하는지 입니다 : CellIdentifier 다른 행을 알고 계십니까?