NSDirectoryEnumerator Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in iOS 2.0 and later. |
| Companion guide | Low-Level File Management Programming Topics |
| Declared in | NSFileManager.h |
Overview
An NSDirectoryEnumerator object enumerates the contents of a directory, returning the pathnames of all files and directories contained within that directory. These pathnames are relative to the directory.
You obtain a directory enumerator using NSFileManager’s enumeratorAtPath: method. For more details, see Low-Level File Management Programming Topics.
An enumeration is recursive, including the files of all subdirectories, and crosses device boundaries. An enumeration does not resolve symbolic links, or attempt to traverse symbolic links that point to directories.
Instance Methods
directoryAttributes
Returns an NSDictionary object that contains the attributes of the directory at which enumeration started.
Return Value
An NSDictionary object that contains the attributes of the directory at which enumeration started.
Discussion
See the description of the fileAttributesAtPath:traverseLink: method of NSFileManager for details on obtaining the attributes from the dictionary.
Availability
- Available in iOS 2.0 and later.
See Also
-
createDirectoryAtPath:attributes:(NSFileManager)
Declared In
NSFileManager.hfileAttributes
Returns an object that contains the attributes of the most recently returned file or subdirectory (as referenced by the pathname).
Return Value
A dictionary that contains the attributes of the most recently returned file or subdirectory (as referenced by the pathname).
Discussion
See the description of the fileAttributesAtPath:traverseLink: method of NSFileManager for details on obtaining the attributes from the dictionary.
Availability
- Available in iOS 2.0 and later.
Declared In
NSFileManager.hlevel
Returns the number of levels deep the current object is in the directory hierarchy being enumerated.
Return Value
The number of levels, with the directory passed to enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: (NSFileManager) considered to be level 0.
Availability
- Available in iOS 4.0 and later.
Declared In
NSFileManager.hskipDescendants
Causes the receiver to skip recursion into the most recently obtained subdirectory.
Discussion
This method is identical to skipDescendents except for the spelling.
Availability
- Available in iOS 4.0 and later.
Declared In
NSFileManager.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-28)