Get the count of files in a directory

cocoa, ios, nsfilemanager, objective-c

Solution

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

Problem

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

Original source