NSURL
provides a method getResourceValue:forKey:error:
. One of the possible keys is the NSURLLocalizedNameKey
which from documentation returns:
The resource’s localized or extension-hidden name, returned as an NSString object (read-only).
What does it mean "localized or extension-hidden name"?
Is it different from just calling [url lastPathComponent]
?
localized
means you get for example Desktop on an English system, Schreibtisch in German or デスクトップ in Japanese.extension-hidden
considers the checkbox in a Finder Info window like
lastPathComponent
returns always the internal non-localized full file/folder name.