이것은 내 cellForRowAtIndexPath
입니다.테이블보기의 반복 된 셀
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Maledetta"];
if (cell == nil) {
UIViewController *c;
if (!IS_IPAD) c = [[UIViewController alloc] initWithNibName:@"NewsRow" bundle:nil];
else c = [[UIViewController alloc] initWithNibName:@"NewsRow_ipad" bundle:nil];
cell = (NewsRowController*)c.view;
if ([titleArray count] > 0) {
[(NewsRowController*)cell setCellDataWithName:[titleArray objectAtIndex:indexPath.row]
andDate:[descArray objectAtIndex:indexPath.row]
day:[dayArray objectAtIndex:indexPath.row]
month:[monthArray objectAtIndex:indexPath.row]];
}
[c release];
}
return cell;
}
내가 왜 단지 4 행을 보여 주며, 그 다음에 네 번째 다른 시간은 10 시까 지 처음으로 반복됩니다.
+-----------------------+
| A
+-----------------------+
| B
+-----------------------+
| C
+-----------------------+
| D
+-----------------------+
| A (repeated)
+-----------------------+
| B (repeated)
+-----------------------+
| C (repeated)
+-----------------------+
| D (repeated)
+-----------------------+
| A (repeated)
+-----------------------+
| B (repeated)
+-----------------------+
아 [titleArray count]
10
는 동일하다. kCustomCellID
이 맞습니다.
감사합니다.
디버거를 단계별로 실행하고 값을 한 번에 하나씩 확인하는 것이 좋습니다. 필요하다면 "po 객체"를 사용하여 객체의 원시 세부 사항을 인쇄 할 수 있습니다. – clifgriffin