Instance Method

initWithURL:options:error:

Initializes a file wrapper instance whose kind is determined by the type of file-system node located by the URL.

Declaration

- (instancetype)initWithURL:(NSURL *)url options:(NSFileWrapperReadingOptions)options error:(NSError * _Nullable *)outError;

Parameters

url

URL of the file-system node the file wrapper is to represent.

options

Option flags for reading the node located at url. See NSFileWrapperReadingOptions for possible values.

outError

If an error occurs, upon return contains an NSError object that describes the problem. Pass NULL if you do not want error information.

Return Value

File wrapper for the file-system node at url. May be a directory, file, or symbolic link, depending on what is located at the URL. Returns NO (0) if reading is not successful.

Discussion

If url is a directory, this method recursively creates file wrappers for each node within that directory. Use the fileWrappers property to get the file wrappers of the nodes contained by the directory.

See Also

Creating File Wrappers

- initWithPath:

Initializes a file wrapper instance whose kind is determined by the type of file-system node located by the path.

Deprecated
- initDirectoryWithFileWrappers:

Initializes the receiver as a directory file wrapper, with a given file-wrapper list.

- initRegularFileWithContents:

Initializes the receiver as a regular-file file wrapper.

- initSymbolicLinkWithDestination:

Initializes the receiver as a symbolic-link file wrapper.

Deprecated
- initSymbolicLinkWithDestinationURL:

Initializes the receiver as a symbolic-link file wrapper that links to a specified file.

- initWithSerializedRepresentation:

Initializes the receiver as a regular-file file wrapper from given serialized data.