How can I use strike-through font in objective C??? More specifically in UITableViewCell
cell.textLabel.text = name;
cell.detailTextLabel.text = quantity ;
cell.XXX = ??
See Question&Answers more detail:osHow can I use strike-through font in objective C??? More specifically in UITableViewCell
cell.textLabel.text = name;
cell.detailTextLabel.text = quantity ;
cell.XXX = ??
See Question&Answers more detail:osthis is Marin, the author of the attributed strings chapter in "iOS6 by Tutorials".
Since iOS6 there is actually a native support for a bunch of different text attributes, including strike-trough.
Here's a short example, which you can use for your cell text label:
NSDictionary* attributes = @{
NSStrikethroughStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
};
NSAttributedString* attrText = [[NSAttributedString alloc] initWithString:@"My Text" attributes:attributes];
cell.textLabel.attributedText = attrText;
That's all. Good luck!