When I tried to better explain my problem, I found an error ... I did it
UIColor _textColor = [UIColor grayColor];
[string addAttribute:(id)kCTForegroundColorAttributeName value:(id)_textColor range:NSMakeRange(0, [string length])];
but not
UIColor _textColor = [UIColor grayColor];
[string addAttribute:(id)kCTForegroundColorAttributeName value:(id)_textColor.CGColor range:NSMakeRange(0, [string length])];
This helps make sure that you are using the correct color object!
source
share