Locates and optionally creates the specified common directory in a domain.
- iOS 4.0+
- macOS 10.6+
- tvOS 9.0+
- watchOS 2.0+
The search path directory. The supported values are described in
Manager .Search Path Directory
Whether to create the directory if it does not already exist.
When creating a temporary directory, this parameter is ignored and the directory is always created.
NSURL for the requested directory.
You typically use this method to locate one of the standard system directories, such as the
Application Support or
Caches directories. After locating (or creating) the desired directory, this method returns the URL for that directory. If more than one appropriate directory exists in the specified domain, this method returns only the first one it finds.
You can use this method to create a new temporary directory. To do so, specify
item for the
user for the
domain parameter, and a URL for the
url parameter which determines the volume of the returned URL.
For example, the following code results in
temporary with a value in the form of