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
精彩评论