开发者

TTStyledTextLabel - unrecognized selector exception

I am using the 2.x compatible branch of Three20 library. I want to display a URL and am using the TTStyledTextLabel for this purpose.

However when trying to use it, I get an exception

*** Terminating app due to uncaugh开发者_如何学Pythont exception 'NSInvalidArgumentException', reason: '*** -[TTStyledTextLabel width]: unrecognized selector sent to instance 0x4bc440'

This is how I am using the TTStyledTextLabel object (inside a custom tableviewcell)

TTStyledTextLabel *textLabel = (TTStyledTextLabel *)[cell.contentView viewWithTag:2];
[textLabel setText:[TTStyledText textFromXHTML:myFormattedText lineBreaks:YES urls:YES]];

Can someone please tell me why this exception occurs?

Thanks.


The width member is added by the category UIViewAdditions on UIView. Can you check that it's there in this release?


I had the same problem, caused due to the Three20 UIViewAdditions categories not being applied.

Check that you have added the -ObjC flag to your "Other Linker Flags" build. I had it missing.

There is more information on these categories not being applied on a Three20's google groups thread

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜