title: Best cocoa data structure for list of files
body: <p>I'm writing a program that processes hundreds of files when run.  Right now each file and folder is stored in an object I created (it contains the filepath, filetype, filesize, a pointer to an offset in the file, and if it is a directory), and those objects are placed in a NSMutableArray.  A big problem with this is at the end of processing all the files, I need to get statistics for all the files in each folder.  I am doing this using 2 nested for loops, and the performance is terrible.</p>
  
  <p>My question is this:  Is there a more efficient way to store a list of files and folders in cocoa (other than NSMutableArray, sets, etc) so I can quickly access all folders and all objects inside those folders?  Is there some structure that will create an array of folders and and array of files and folders located in that parent folder?</p>