1

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,

ludo
  • 1,479
  • 5
  • 25
  • 50

2 Answers2

4

Perhaps you want to try UIWebView, instead?

Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
  • 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
    in the text, is it really impossible to display?
    – ludo Dec 09 '09 at 07:42
1

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 king
  • 112,709
  • 45
  • 203
  • 241