You can use the method NSFileManager's -contentsOfDirectoryAtPath:error:to get an array with the contents of the directory (as strings). NSStringhas a method -pathExtensionthat makes it easy to get the file extension. All that remains is to iterate over the array looking for strings whose -pathExtensionextension matches what you are looking for. Alternatively, you could use -filteredArrayUsingPredicate:to determine the corresponding strings.
Caleb source
share