• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to display HTML in proper format in a NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to display HTML in proper format in a NSTextView
      • From: Jens Alfke <email@hidden>
    • Re: How to display HTML in proper format in a NSTextView
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: NSTableView Bindings and Numbered Lines...
  • Next by Date: Weird Core Data crash
  • Previous by thread: Re: NSTableView Bindings and Numbered Lines...
  • Next by thread: Re: How to display HTML in proper format in a NSTextView
  • Index(es):
    • Date
    • Thread