Pregunta

He oído que NSAttributedString se añade en iPhone pero cuando se utiliza la tecla NSForegroundColorAttributeName para configurar el color me sale un error que dice "NSForegroundColorAttributeName no declarada". Me estoy perdiendo algo? Por favor, ayúdame.

Regards

Yallappa

¿Fue útil?

Solución

Trate de usar kCTForegroundColorAttributeName lugar.

Otros consejos

me encontré con el mismo problema que se menciona BarretJ utiliza la constante kCTForegroundColorAttributeName. He aquí un ejemplo:

NSMutableAttributedString* attrStr = [[NSMutableAttributedString alloc] initWithString:countStr attributes:nil];

[attrStr addAttribute:(NSString*)kCTForegroundColorAttributeName 
                value:(id)[[UIColor greenColor] CGColor]
                range:range];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top