title: Iterating through files in a folder with nested folders - Cocoa
body: <p>I need to access every file in a folder, including file that exist within nested folders. An example folder might look like this.</p>
  
  <pre><code>animals/
   -k.txt
   -d.jpg
   cat/
     -r.txt
     -z.jpg
     tiger/
        -a.jpg
        -p.pdf
   dog/
     -n.txt
     -f.jpg
   -p.pdf
  </code></pre>
  
  <p>Say that I wanted to run a process on every file within "animals" that isn't folder. What would be the best way to iterate through the folder "animals" and all of its subfolders to access every file?</p>
  
  <p>Thanks.</p>