Performs a deep enumeration of the specified directory and returns the paths of all of the contained subdirectories.
- iOS 2.0+
- macOS 10.5+
- tvOS 9.0+
- watchOS 2.0+
The path of the directory to list.
If an error occurs, upon return contains an
NSErrorobject that describes the problem. Pass
NULLif you do not want error information.
An array of
NSString objects, each of which contains the path of an item in the directory specified by
path is a symbolic link, this method traverses the link. This method returns
nil if it cannot retrieve the device of the linked-to file.
This method recurses the specified directory and its subdirectories. The method skips the “
.” and “
..” directories at each level of the recursion.
Because this method recurses the directory’s contents, you might not want to use it in performance-critical code. Instead, consider using the
enumerator method to enumerate the directory contents yourself. Doing so gives you more control over the retrieval of items and more opportunities to complete the enumeration or perform other tasks at the same time.