• 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
Re: Overriding HTML translation in NSAttributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding HTML translation in NSAttributedString


  • Subject: Re: Overriding HTML translation in NSAttributedString
  • From: Nicko van Someren <email@hidden>
  • Date: Fri, 11 Nov 2005 22:43:33 +0000

On 11 Nov 2005, at 22:01, Glen Simmons wrote:

I'm using NSAttributedString to get some XHTML into an NSTextView. It's working well, but I need to tweak one thing. The XHTML has some tags like this:
<img src="foo://bar.png" ...
The "foo:" scheme tells me that the image is actually part of my internal data, not a file on disk. I'd like to step in at the point when NSAttributedString is translating this into an NSTextAttachment and supply the image, rather than getting the little blue square with question mark. Is there a good way to do this?

Presumably you can create a subclass of NSURLProtocol which implements the "foo:" protocol. Make its +initialize call +registerClass: to hook it into the URL handling system and, I would guess, WebKit will make use of it for the "foo:" URLs. You could then just return the image data based on the leaf name given.


	Nicko


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Overriding HTML translation in NSAttributedString (From: Glen Simmons <email@hidden>)

  • Prev by Date: mlRe: Correct way to scale an NSTextView
  • Next by Date: Re: Using Objective-C From JavaScript
  • Previous by thread: Re: Overriding HTML translation in NSAttributedString
  • Next by thread: mlRe: Correct way to scale an NSTextView
  • Index(es):
    • Date
    • Thread