I have a table whose cells contain labels. Whenever I delete a reusable cell, the old shortcuts still linger on it. I was able to remove them using this:
for(int a=[[newcell subviews]count]-1; a>=0;a--)
{
if([[[[newcell subviews]objectAtIndex:a]class] isSubclassOfClass:[UILabel class]])
{
[[[newcell subviews] objectAtIndex:a] removeFromSuperview];
}
}
But when I select a cell, I see the old text on top of the new one. I tried this:
[[newcell.selectedBackgroundView subviews] makeObjectsPerformSelector: @selector(removeFromSuperview)];
[[newcell.backgroundView subviews] makeObjectsPerformSelector: @selector(removeFromSuperview)];
But that did not work. How can I remove old marks from a selected cell as well as the normal view of a cell?
source
share