views:

499

answers:

1

Hi out there:

i got an object with contents of html markup in it, for example:

string = @"<p>This is wonderful</p> <p>Also some &#8216; entidies &#8217; <p>";

so i want first to convert this entidies in for my label text.

the second step would be to convert my p tags to line breaks.

the third step to convert my "img" tags to uiimageviews and some simple text formatting "b","strong" etc.

have you any ideas how to solve my problem?

+2  A: 

You should have a look at the Three20 project which includes a class TTStyledTextLabel which allows you to render HtmL-Code and even activates links.

TTStyledTextLabel  *htmlLabel = [[[TTStyledTextLabel alloc] initWithFrame:self.contentView.bounds] autorelease];
htmlLabel.userInteractionEnabled = YES;
[aView addSubview:htmlLabel];

htmlLabel.text = [TTStyledText textFromXHTML:htmlText];
Felix
is it possible to include only this TTStyledTextLabel object? three20 is very large, isnt it? with Photoviewer and other stuff
choise
You will probably need to include more than just that Class, but you might well be able to strip out those parts that you don't need.
Felix