- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我使用 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/
我使用 DTCoreText 在 iOS 中呈现 HTML 文档。我注意到有些图像没有显示。这些图像在 src 中具有相对 url。当我将 src 值更改为文件名并将图像放置到与 html 文档相同的
我得到错误: -[__NSCFType lineBreakMode]: unrecognized selector sent to instance 当以下代码完成执行时: NSDictionary
我正在使用 DTCoreText 显示 HTML 代码。到目前为止一切正常,但现在我在此 HTML 代码中收到嵌入的推文,但它们无法正常工作。 正如 Twitter 文档中所说,推文嵌入了 block
xcode 4.5.2 DTCoreText1.1 我尝试了很多方法,但都失败了。有人有这方面的经验吗? 如何将DTCoreText集成到新项目中? 我将我的文件上传到 www.uethink.com
我之前就这个问题提出了一个问题,但我已经清理了项目并从头开始重新启动。 我正在尝试使用 DTCoreText 我的播客文件: platform :iOS pod 'DTCoreText' ^quote
我想使用 DTCoreText在我的应用程序中将 HTML 转换为 NSAttributedString,但我不知道如何使用系统字体(从 iOS 8 开始:Helvetica Neue)作为基本字体。
我试图实现 DTCoreText .我关注这个guide并将其实现为 git submodul,但现在当我尝试运行我的应用程序时出现错误。目前我没有使用 DTCoreText 进行任何编码。我只想测试
我想使用 DTCoreText 从 HTML 到 NSAttributedString 有多个/嵌套的超标. 如果我采用以下 HTML: Some text with a superscript 在
我试图让 DTCoreText 改变一些来自 JSON 的简单 HTML。我试图实现他们在示例中给出的简单“烟雾文本”,但我在让开关正常工作时遇到了问题。有没有人在swift 3中用过。 我不确定此时
let callBackBlock:(DTHTMLElement) -> Void = { element in for oneChildElement in element.chil
我使用 DTCoreText 的 DHTMLAttributedStringBuilder 在 UITableViewCell 中显示 HTML 代码。但它有一个错误。这是我的代码: NSDictio
我想从 html 转换为 NSAttributedString,我发现在这里使用 DTCoreText 解决了这个问题 https://github.com/Cocoanetics/DTCoreTex
我正在使用 DTCoreText 创建 HTML 属性字符串。 DTCoreText 返回的属性字符串有一个名为“CTForegroundColor”的属性,其中包含文本颜色信息。当我在 UI 上显示
我是 Objective-C 的新手,我试图在我的项目中使用 DTCoreText 来获取 html 内容。我点击了这个链接( https://github.com/yas375/DTCoreText
我有 DTAttributedTextContentView,我成功地从 HTML 渲染文本。现在我想嵌入与文本内嵌显示的图片。我查看了文档,只有 Objective-C 示例。如何在 Swift 上
我是一名优秀的程序员,十分优秀!