I try to retrieve HTML data from my database and display them in a UITextView, the only problem is t开发者_StackOverflowhat 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,
Perhaps you want to try UIWebView
, instead?
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.
精彩评论