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

时间:2009-12-09 19:52:09

标签: 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]];

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

感谢。

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

我遇到了同样的问题,原因是没有应用Three20 UIViewAdditions类别。

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

有关这些类别的更多信息未在Three20's google groups thread

上应用
相关问题