Re: -[NSURL path] returning empty string for relative file URL
Re: -[NSURL path] returning empty string for relative file URL
- Subject: Re: -[NSURL path] returning empty string for relative file URL
- From: Douglas Davidson <email@hidden>
- Date: Fri, 11 Nov 2005 09:12:51 -0800
On Nov 11, 2005, at 6:45 AM, Glen Simmons wrote:
Well, I'm not creating the NSURL in this case, the NSTextView is.
I'm shoving some XHTML into the NSTextView and it's interpreting
anchors as clickable links. When clicked, my
textView:clickedOnLink:atIndex: method gets called with the NSURL
in question. The original XHTML had this:
<a href="foo.bar"><span>Link to foo.bar</span></a>
But if I shove it into the NSTextView like that, the NSURL I get
back looks like this:
applewebdata://108AB768-64CD-41CF-94FA-C4558EBA0B1E/foo.bar
which is a bit difficult to deal with.
In that case, I think what you want is to specify the base URL in
your document options when you create the attributed string, using
NSBaseURLDocumentOption. Without a base URL, the initWithData...
method can't properly interpret relative URLs.
Douglas Davidson
_______________________________________________
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