Root URL and URLByDeletingLastPathComponent
Root URL and URLByDeletingLastPathComponent
- Subject: Root URL and URLByDeletingLastPathComponent
- From: email@hidden
- Date: Sun, 17 Jul 2016 02:48:19 -0400
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.
Cheers,
Demitri
_______________________________________________
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