gpt4 book ai didi

ios - 使用 DTCoreText 显示 HTML 代码时出错

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:58:32 45 4
gpt4 key购买 nike

我使用 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/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com