我使用 DTCoreText 的 DHTMLAttributedStringBuilder 在 UITableViewCell 中显示 HTML 代码。但它有一个错误。 这是我的代码:
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;
这是错误:
[__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'
最佳答案
我遇到了同样的问题。结果我试图在 UILabel 而不是 TTTAttributedLabel 上设置文本。
关于ios - 使用 DTCoreText 显示 HTML 代码时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30678915/