You can use delegate methods of the UITableView
for this.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * cell;
// Initialize cell
// If you want to use custom label, don't forget to set it a unique tag.
cell.textLabel.text = @"Label";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * selectedCell = [tableView cellForRowAtIndexPath:indexPath];
// If you created a custom label, get it like the next line and then change the color of it;
// UILabel * label = (UILabel *) [selectedCell viewWithTag: UNIQUE_TAG];
selectedCell.textLabel.textColor = [UIColor redColor]; // Or which color you'd like.
}