How to display HTML in proper format in a NSTextView
How to display HTML in proper format in a NSTextView
- Subject: How to display HTML in proper format in a NSTextView
- From: Sandeep Mohan Bhandarkar <email@hidden>
- Date: Tue, 29 Nov 2011 01:27:41 -0800
Hi All,
I am trying to display HTML content in a NSTextView in such a way that the HTML content is visible within the Text area and the user can also edit the Non HTML sections. for doing this I have made use of the following
code.
NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:htmlData documentAttributes:NULL];
[[responseTextView textStorage] setAttributedString:attrString];
Here htmlData is an NSData object that has been initialized with the contents of an HTML File. However on doing this the HTML Displayed in the Text view does not seem to be formatted correctly. Please see the figure below.
Can some one let me know how we can display the HTML with the appropriate spacing etc.
Thanks and Regards,
Sandeep Mohan Bhandarkar.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden