1

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

Thanks

ncohen
  • 6,936
  • 21
  • 70
  • 118

2 Answers2

3
NSMutableAttributedString *strikeThroughString = [[NSMutableAttributedString alloc] initWithString:anyString];
[strikeThroughString addAttribute:NSStrikethroughStyleAttributeName value:(NSNumber *)kCFBooleanTrue range:NSMakeRange(0, [as length])];
[m_cObjTaskTitle setAttributedText:strikeThroughString =];
cObjTaskTitle = UILabel ;
Mick MacCallum
  • 126,953
  • 40
  • 282
  • 279
Mushtaque
  • 31
  • 1
2

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];
VisioN
  • 138,460
  • 30
  • 271
  • 271
NSSplendid
  • 1,947
  • 1
  • 13
  • 14