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: Niko Matsakis <email@hidden>
- Date: Fri, 11 Nov 2005 14:51:47 +0100
Hmm. The problem there is that if I don't put in a scheme, then the
NSURL I get back when the link is clicked in the NSTextView is that
applewebdata thing, which is a bit ... unwieldy.
After sending my message I feared you would encounter this problem.
I'm not familiar with the specifics of your situation, but I think
your only hope is to obtain the relevant "Base URL" and construct a
URL like so:
NSURL *url = [NSURL URLWithString:@"relative/path"
relativeToURL:baseURL];
If you do not know the base URL at the time, then you cannot store an
NSURL. To my knowledge, NSURL instances are always absolute. You'll
have to settle for storing the string and converting it to a URL when
the base URL is known.
Niko
_______________________________________________
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