Ce poste est étroitement lié à mon précédent post: TDBadgedCell keeps caching the BadgeNumberproblèmes de caching avec TDBadgedCell
Le "badge" de la mise en cache TDBadgedCell conserve les numéros. Un exemple très simple est montré ici:
- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
TDBadgedCell *cell = (TDBadgedCell *)[_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[TDBadgedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
}
[cell setBadgeColor:[UIColor blackColor]];
[cell setBadgeNumber:[indexPath row]];
[[cell textLabel] setText:[NSString stringWithFormat:%@"%d", [indexPath row]]];
return cell;
}
Quelqu'un a la moindre idée pourquoi cela se produit? Le textLabel et detailTextLabel ne mettent pas en cache les données. Toute information additionnelle serait la bienvenue, car il semble y avoir beaucoup de problèmes avec la mise en cache des graphiques dans UITableViewCells. Toutes les meilleures pratiques ou d'autres informations utiles seraient les bienvenues.