Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm creating a CFMutableAttributedStringRef with attributes and then passing this to Objective-C.

return (__bridge NSAttributedString *)myAttributedStringRef;

Most attributes like fonts have toll-free bridging with their Obj-C counterparts but not color attributes. NSForegroundColorAttributeName and kCTForegroundColorAttributeName do not bridge nor do UIColor and CGColorRef.

For example, I'm setting the text color like this but it doesn't bridge to it's Obj-C counterpart.

CFAttributedStringSetAttribute(string, range, kCTForegroundColorAttributeName, myCGColor);

Is it possible to somehow set the text color in core foundation and then pass this to Obj-C?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.