我使用的是Three20库的2.x兼容分支。我想要显示一个网址,并为此使用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]];有人能告诉我为什么会发生这种异常吗?
谢谢。
发布于 2009-12-10 08:22:15
width成员由UIView上的类别UIViewAdditions添加。你能检查一下这个版本中有没有它?
发布于 2009-12-16 21:05:47
我也遇到了同样的问题,这是由于没有应用Three20 UIViewAdditions类别造成的。
检查是否已将-ObjC标志添加到“其他链接器标志”版本中。我把它丢了。
有关未在Three20's google groups thread上应用的这些类别的详细信息
https://stackoverflow.com/questions/1876373
复制相似问题