1

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

Thanks

Nate
  • 7,606
  • 23
  • 72
  • 124

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
  • 129,200
  • 40
  • 280
  • 281
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
  • 143,310
  • 32
  • 282
  • 281
NSSplendid
  • 1,957
  • 1
  • 13
  • 14