Search code examples
objective-cioscocoansfilemanager

Get the count of files in a directory


How can I count the files in a directory? I couldn't find anything relevant in the class reference of NSFileManager.


Solution

  • contentsOfDirectoryAtPath:error: returns an NSArray. Just send count to the array.