I have placeholder text in a textfield (called countTotalFieldUniversal) that I want to change color when I click the Edit button.
Currently, my code is:
- (void)setEditing:(BOOL)flag animated:(BOOL)animated
{
NSLog(@"setEditing called");
[super setEditing:flag animated:animated];
if (flag == YES){
NSLog(@"Flag is yes");
[countTotalFieldUniversal setValue:[UIColor darkGrayColor]
forKeyPath:@"_placeholderLabel.textColor"];
NSLog(@"Color should be grey...");
}
else {
// Edit not selected
}
}
My console prints out that "Flag is yes" and "Color should be grey..." but the text doesn't change. Am I setting the text incorrectly?