Reputation: 417
This sounds basic, but then again it may not be. I have some text in a cell that I want to go bold when an event happens and unbold when another happens, I know how to handle the event, but how do I make it bold and then unbold it.
Upvotes: 0
Views: 295
Reputation: 27073
Make text bold is specific range:
NSMutableAttributedString *theText = [theTextView textStorage];
[theText applyFontTraits:NSBoldFontMask range:NSMakeRange(0,[text length])];
Optionally how to get the selected range:
NSRange theSelectedRange = [theTextView selectedRange];
Upvotes: 1