I use DTHTMLAttributedStringBuilder of DTCoreText to display HTML code in UITableViewCell. But it has an error. This is my code:
NSDictionary *builderOptions = @{DTDefaultFontFamily: @"Helvetica"};
DTHTMLAttributedStringBuilder *stringBuilder = [[DTHTMLAttributedStringBuilder alloc] initWithHTML:[word[@"name"] dataUsingEncoding:NSUTF8StringEncoding] options:builderOptions documentAttributes:nil];
NSAttributedString *stringAttri = [stringBuilder generatedAttributedString];
cell.textLabel.attributedText = stringAttri;
This is error:
[__NSCFType lineBreakMode]: unrecognized selector sent to instance 0x7f7f7bd1ba60
2015-06-06 11:16:38.898 PhrasalVerb[786:18798] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType lineBreakMode]: unrecognized selector sent to instance 0x7f7f7bd1ba60'
I had the same issue. Turns out I was trying to set the text on a UILabel and not a DTAttributedLabel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With