This is driving me crazy. I've looked here on S.O. for what I thought was a simple answer but couldn't find one.
In my custom UITableViewCell
:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
// Configure the view for the selected state
if (selected) {
[self.languageLevelNameLabel setTextColor:[UIColor blackColor]];
}
else {
[self.languageLevelNameLabel setTextColor:[UIColor colorMessageCountZero]];
}
[self setNeedsDisplay];
}
In tableView:cellForRowAtIndexPath:
of the controller:
if ([level integerValue] == indexPath.row) {
[cell setSelected:YES];
}
I've inserted break points and selected == YES
is getting passed for the correct cell, and the if
statement is being executed when it should be, but the text never gets set to blackColor
.
-setSelected:
does not call-setSelected:animated:NO
internally.