Instance Method

initDirectoryWithFileWrappers:

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

Declaration

- (instancetype)initDirectoryWithFileWrappers:(NSDictionary<NSString *,NSFileWrapper *> *)childrenByPreferredName;

Parameters

childrenByPreferredName

Key-value dictionary of file wrappers with which to initialize the receiver. The dictionary must contain entries whose values are the file wrappers that are to become children and whose keys are filenames. See Accessing File Wrapper Identities in File System Programming Guide for more information about the file-wrapper list structure.

Return Value

Initialized file wrapper for fileWrappers.

Discussion

After initialization, the file wrapper is not associated with a file-system node until you save it using writeToURL:options:originalContentsURL:error:.

The receiver is initialized with open permissions: anyone can read, write, or modify the directory on disk.

If any file wrapper in the directory doesn’t have a preferred filename, its preferred name is automatically set to its corresponding key in the childrenByPreferredName dictionary.

See Also

Creating File Wrappers

- initWithURL:options:error:

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

- initWithPath:

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

Deprecated
- 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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software