I just noticed something very strange with the UITableViewCell class on iOS and the userInteractionEnabled property.
It appears that if userInteractionEnabled is set
I found that if I put cell.textLabel.textColor = [UIColor blackColor];
right before cell.userInteractionEnabled = NO;
, it seems to fix the problem. This is how it is working on iOS 6.0.1
cell.textLabel.textColor = [UIColor blackColor];
cell.userInteractionEnabled = NO;
I think I found a more convenient workaround for this problem (which I consider to be a bug):
Set the enabled
property on textLabel
and detailTextLabel
manually like this:
cell.userInteractionEnabled = (indexPath.row % 2) == 0;
cell.textLabel.enabled = cell.isUserInteractionEnabled;
cell.detailTextLabel.enabled = cell.isUserInteractionEnabled;
This led me to the answer: https://stackoverflow.com/a/13327632/921573