• 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] "If the path has a trailing slash it is stripped"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSURL path] "If the path has a trailing slash it is stripped"


  • Subject: Re: -[NSURL path] "If the path has a trailing slash it is stripped"
  • From: Charles Srstka <email@hidden>
  • Date: Mon, 09 Apr 2012 21:53:38 -0500

On Apr 9, 2012, at 7:05 PM, Jerry Krinock wrote:

> In current documentation, CFURLCopyStrictPath() still has the ambiguity, but CFURLCopyPath() has been corrected.  It says, unambiguously, "nor does it replace percent escape sequences".

The documentation says:

"This function does not resolve the URL against its base and replaces all percent escape sequences. This function's return value does not include a leading slash and uses isAbsolute to report whether the URL's path is absolute.”

That’s not ambiguous; it’s just wrong. The documentation states completely unambiguously that it *does* replace percent escapes and that it *doesn’t* leave the trailing slash on there. Unfortunately, I just tried it and you are correct; the function does not behave in the manner described by the documentation. This is a problem, because if you’re getting a path to provide to a path-based function or method, you need to resolve the percent escapes or it obviously won’t work.

Fortunately, CFURLCopyFileSystemPath with kCFURLPOSIXPathStyle *does* seem to provide a path similar to -path (and I just tested it), so it is doable.

Charles


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >-[NSURL path] "If the path has a trailing slash it is stripped" (From: Jerry Krinock <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Ken Thomases <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Jerry Krinock <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Jens Alfke <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Charles Srstka <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Mike Abdullah <email@hidden>)
 >Re: -[NSURL path] "If the path has a trailing slash it is stripped" (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Confusion about KVC and custom setter
  • Next by Date: Is UIWebView KVO compliant?
  • Previous by thread: Re: -[NSURL path] "If the path has a trailing slash it is stripped"
  • Next by thread: Re: -[NSURL path] "If the path has a trailing slash it is stripped"
  • Index(es):
    • Date
    • Thread