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: Glen Simmons <email@hidden>
- Date: Fri, 11 Nov 2005 11:24:19 -0600
On Nov 11, 2005, at 11:12 AM, Douglas Davidson wrote:
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.
Niko beat you to it, but yes, that's the answer.
Thanks,
Glen
_______________________________________________
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