ios - Get HTML in UITextView -


i display html in uitextview by:

[self.textview setvalue:@"<b>content</b>" forkey:@"contenttohtmlstring"];,

after editing content in uitextview, want content include html use:

[self.textview valueforkey:@"contenttohtmlstring"]; app crash, how fix it?

for ios 7 use following code.

nsstring *htmlstring = @"<h1>header</h1><h2>subheader</h2><p>some <em>text</em></p><img src='http://blogs.babble.com/famecrawler/files/2010/11/mickey_mouse-1097.jpg' width=70 height=100 />";         nsattributedstring *attributedstring = [[nsattributedstring alloc] initwithdata:[htmlstring datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil];         textview.attributedtext = attributedstring; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -