views:

131

answers:

2

Hi,

I try to retrieve HTML data from my database and display them in a UITextView, the only problem is that I don't know how to tell him that its HTML code and not only text, for the moment I have that:


NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(getFicheStatement , 1)];

Thanks,

+3  A: 

Perhaps you want to try UIWebView, instead?

Alex Reynolds
UIWebView is the only way to display the HTML?I created a UIView in Interface Builder, so I display many things n different part like Title, short description...In the description part I just put some <br> in the text, is it really impossible to display?
ludo
A: 

You won't be able to put any styles into a UITextView. If you want to keep the styles that are in the HTML, the simplest thing to do is to put it into a UIWebView. If you don't want to use a UIWebView, you'll have to parse the HTML yourself, then try to style lots of UILabels and put them together, making sure they align properly. You'll have to deal with flowing the text yourself too.

A UIWebView will save you a lot of trouble.

nevan
Ok I see thank you, that seems complicated. Anyway how do you parse the HTML?
ludo
This might help you: http://stackoverflow.com/questions/405749/parsing-html-on-the-iphone
nevan
ok thanks for the link I will take a look
ludo