iphone - TTStyledTextLabel - 无法识别的选择器异常

标签 iphone three20

我正在使用 Three20 库的 2.x 兼容分支。我想显示一个 URL,并为此目的使用 TTStyledTextLabel。

但是当尝试使用它时,我遇到了异常

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[TTStyledTextLabel width]: unrecognized selector sent to instance 0x4bc440'

这就是我使用 TTStyledTextLabel 对象的方式(在自定义 tableviewcell 内)

TTStyledTextLabel *textLabel = (TTStyledTextLabel *)[cell.contentView viewWithTag:2];
[textLabel setText:[TTStyledText textFromXHTML:myFormattedText lineBreaks:YES urls:YES]];

有人可以告诉我为什么会出现这个异常吗?

谢谢。

最佳答案

width 成员由 UIView 上的类别 UIViewAdditions 添加。你能检查一下这个版本中是否有它吗?

关于iphone - TTStyledTextLabel - 无法识别的选择器异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1876373/

相关文章:

iphone - TTSearchTextFieldDelegate 不调用 textField :didSelectObject:

iOS: Three20: TTTableItem Delegate: 如何唯一标识tableItem?

iphone - Three20:将表项链接到 ViewController

iphone - 重新加载数据时 TableView Controller 不显示事件状态

ios - 以编程方式获取 IOS 设备的 UDID?

iphone - 快速访问 Core Data 数据库信息?

iphone - 这个 'pop-up' View 是如何创建的?

ios - XMPP 应用终止且未收到消息

iphone - 使用自定义 TTPhotoView 扩展 TTPhotoViewController

ios - 为什么我不能在 iPhone 上编译引用 vImage 库的代码?