• 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: Root URL and URLByDeletingLastPathComponent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Root URL and URLByDeletingLastPathComponent


  • Subject: Re: Root URL and URLByDeletingLastPathComponent
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 17 Jul 2016 11:30:34 +0100

> On 17 Jul 2016, at 07:48, email@hidden wrote:
>
> Hello,
>
> Sanity check here. I have this code:
>
> NSURL *rootURL = [NSURL fileURLWithPath:@"/"];
> NSLog(@"%@", rootURL, [rootURL URLByDeletingLastPathComponent]);
>
> Based on the NSURL documentation:
>
>> If the receiver’s URL represents the root path, this property contains a copy of the original URL.
>
> I'd expect the output to be:
>
> file:///, file:///
>
> Instead, I get this:
>
> file:///, file:///../
>
> Am I misunderstanding something here, or is this a bug? Technically, if you "cd ../" from root you stay at root, but this is still contradicting the documentation.

It might be a mishandling of the two sorts of rot URL. If you try feeding in this URL manually:

file://localhost/

and removing the last component, what do you end up with?


_______________________________________________

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


  • Follow-Ups:
    • Re: Root URL and URLByDeletingLastPathComponent
      • From: Charles Srstka <email@hidden>
    • Re: Root URL and URLByDeletingLastPathComponent
      • From: email@hidden
References: 
 >Root URL and URLByDeletingLastPathComponent (From: email@hidden)

  • Prev by Date: Root URL and URLByDeletingLastPathComponent
  • Next by Date: Keyboard/Mouse Event Interaction
  • Previous by thread: Root URL and URLByDeletingLastPathComponent
  • Next by thread: Re: Root URL and URLByDeletingLastPathComponent
  • Index(es):
    • Date
    • Thread