I have a UITableView
which is using custom UITableViewCell
s to display some information. I'd like to add a UITableViewCellAccessoryDisclosureIndicator
to the cells.
Every method that I try successfully adds the chevron, but once the table view scrolls down, they disappear. I'm doing the standard dequeueReusableCellWithIdentifier
method, and when I dump out the references to the cells, it's re-using them properly. All of the other data displays fine, it's only the chevrons that disappear.
Things I've tried:
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator];
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
accessoryTypeForRowWithIndexPath:
Anyone ever have this happen?
Best Solution
It could happen because you are setting your accessory type outside of the cached cell test:
The better way, IMHO is like this:
Cocoa Touch doesn't seem to want to modify the cached instance of the cell ( subviews ) setting the disclosure indicator in the cell set method results in the indicator being cached, and redrawn once the cell appears again.