2

我正在使用 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]];

有人可以告诉我为什么会发生这种异常吗?

谢谢。

4

2 回答 2

1

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

于 2009-12-10T00:22:14.783 回答
0

由于未应用 Three20 UIViewAdditions 类别,我遇到了同样的问题。

检查您是否已将 -ObjC 标志添加到“其他链接器标志”构建中。我把它弄丢了。

有关这些类别的更多信息未应用于Three20 的谷歌群组线程

于 2009-12-16T13:05:47.480 回答