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