tags:

views:

891

answers:

4

I have a case where i'm getting formatted text with <a href ...>, <em>, <br>, &quot;, etc tags, and i'm showing it in a Text View. How can i apply these formats? If i can't, whats the most generic way to remove all these tags?

Thanks, Mustafa

+3  A: 

If you want editable text you will have to parse it using a library like Tidy to get just an NSString and then pass that to UITextView's -setText: method

If you need to display HTML, use UIWebView.

If you want to edit HTML as formatted text you will have to roll your own or use private API's.

rpetrich
A: 

No, i just want to show the formatted text in non editable NSTextView. or maybe UIWebView, will it automatically handle tags like <em>?

Mustafa
Respond to people by adding comments, not by adding new answers.
Chris Hanson
A: 

UIWebView will handle all tags like a browser does. So you can use UIWebView.

lostInTransit
A: 

How about if i want to give a rich text editable area? I can show rich text in a UIWebView (Thanks for the pointer guys).

Mustafa