• 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: -[NSURL path] returning empty string for relative file URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: -[NSURL path] returning empty string for relative file URL
      • From: Glen Simmons <email@hidden>
References: 
 >-[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Rob Mayoff <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Niko Matsakis <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)

  • Prev by Date: Re: Closing alert sheet
  • Next by Date: how to count NSThreads and NSTasks ?
  • Previous by thread: Re: -[NSURL path] returning empty string for relative file URL
  • Next by thread: Re: -[NSURL path] returning empty string for relative file URL
  • Index(es):
    • Date
    • Thread