我正在使用 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]];
有人可以告诉我为什么会发生这种异常吗?
谢谢。