tags:

views:

280

answers:

2

Hi

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 uncaught 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.

+1  A: 

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

lyonanderson
Seemed to be missing there. I just replaced self.width with self.frame.size.width and this seemed to resolve it. Thanks.
lostInTransit
A: 

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

Ross