Question

This question already has an answer here:

I would like to know if there is an easy way to strike/cross out some text on the iPhone?

Thanks

Was it helpful?

Solution

Yes and No,

NSString is a simple class, that only stores unformated text, but you can use an NSAttributedString to store such information, i.e.

NSAttributedString* italicText = [[NSAttributedString alloc] initWithString:myNsString attributes:myCrossOutAttributes];

OTHER TIPS

NSMutableAttributedString *strikeThroughString = [[NSMutableAttributedString alloc] initWithString:anyString];
[strikeThroughString addAttribute:NSStrikethroughStyleAttributeName value:(NSNumber *)kCFBooleanTrue range:NSMakeRange(0, [as length])];
[m_cObjTaskTitle setAttributedText:strikeThroughString =];
cObjTaskTitle = UILabel ;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top