Instance Property

URLByStandardizingPath

A URL that points to the same resource as the original URL using an absolute path. (read-only)

Declaration

@property(readonly, copy) NSURL *URLByStandardizingPath;

Discussion

This property only works on URLs with the file: path scheme. For all other URLs, it returns a copy of the original URL.

Like stringByStandardizingPath, this property can make the following changes in the provided URL:

  • Expand an initial tilde expression using stringByExpandingTildeInPath.

  • Reduce empty components and references to the current directory (that is, the sequences “//” and “/./”) to single path separators.

  • In absolute paths only, resolve references to the parent directory (that is, the component “..”) to the real parent directory if possible using stringByResolvingSymlinksInPath, which consults the file system to resolve each potential symbolic link.

    In relative paths, because symbolic links can’t be resolved, references to the parent directory are left in place.

  • Remove an initial component of “/private” from the path if the result still indicates an existing file or directory (checked by consulting the file system).

Note that the path contained by this property may still have symbolic link components in it. Note also that this property only works with file paths (not, for example, string representations of URLs).

See Also

Modifying and Converting a File URL

filePathURL

A file path URL that points to the same resource as the URL object. (read-only)

- fileReferenceURL

Returns a new file reference URL that points to the same resource as the receiver.

- URLByAppendingPathComponent:

Returns a new URL made by appending a path component to the original URL.

- URLByAppendingPathComponent:isDirectory:

Returns a new URL made by appending a path component to the original URL, along with a trailing slash if the component is designated a directory.

- URLByAppendingPathExtension:

Returns a new URL made by appending a path extension to the original URL.

URLByDeletingLastPathComponent

A URL created by taking the receiver and removing the last path component. (read-only)

URLByDeletingPathExtension

A URL created by taking the receiver and removing the path extension, if any. (read-only)

URLByResolvingSymlinksInPath

A URL that points to the same resource as the receiver and includes no symbolic links. (read-only)