Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSString to HTML

I'm showing NSString in a UIWebview to show the text with custom smileys (images) but I got into trouble as UIWebview is not able to detect special characters like \n,\r,\t, whitespaces,&,<,> and many more of the string.How to convert a NSString to HTML string to load in a UIWebView ?

like image 614
Shubham Sharma Avatar asked Oct 05 '22 11:10

Shubham Sharma


1 Answers

There's no built in solution for that. You have to encode the HTML entities. There is an open-source project called NSString-HTML which might suit your needs.

There is also a good NSString category here, which is based on Google's Toolbox.

like image 121
Attila H Avatar answered Oct 17 '22 01:10

Attila H