views:

253

answers:

1

Hi everyone,

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

Thanks

+1  A: 

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 initWithString:myNsString attributes:myCrossOutAttributes];
NSSplendid
Note: NSAttributedString is available only since ≥3.2.
KennyTM
shoot... If I develop for 3.0 I can't strike out?
ncohen
Nope, not using NSAttributedString. You could however subclass UILabel and add some custom drawing code in -drawRect:, like KennyTM said.
Rengers
Unfortunately, you are correct and that leaves us with a "No, it is not easy" as an answer. ):
NSSplendid
Someone could help me for the hard solution?
ncohen