views:

456

answers:

1

Hi,

How can I use strike-through font in objective C??? More specifically in UITableViewCell

cell.textLabel.text = name;
cell.detailTextLabel.text = quantity ;
cell.XXX = ??
+2  A: 

There is not native support for strike-through or underline fonts. You have to draw the lines yourself over the views for the labels.

This is silly since the font inspector for IB has options to set strike-through and underline, but these are promptly ignored if you try to set them.

Brandon Bodnár
Is there any documentation somewhere to back this up? (Not that I doubt it, just wondering.)
Tim
@Tim, Other than that NSAttributedString and the Attributed String Programming Guide don't exist in the iPhone Dev References, no. The lack of documentation is the best I can do.
Brandon Bodnár
I've ever tried to change to strike-through in IB, but it was ignored as you said.
wal
IB is showing fonts and settings available on Mac OS X, but this has little or nothing to do with the iPhone's capabilities. It's IB not being aware enough of the iPhone-- the iPhone simply doesn't have strikethrough fonts to use.
Tom Harrington