Searching all files in all folders

Discussion in 'iOS Programming' started by larswik, May 19, 2012.

  1. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #1
    Is there a Class that I can use to say search my documents directory and it would search through all the sub directories and so on finding files? I want to create a list of all files in all directories from a given directory.

    My goal is for my app to do house cleaning. A client might have 3 images this month but last month they had 8. It is only displaying 3 of the images now but all 8 are still stored on the phone. I want to remove the unused ones.

    I can do it by feeding it the paths to all the clients and all the folders but I thought there might be a Class that I am unaware of that can enumerate through everything?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
  3. larswik, May 19, 2012
    Last edited: May 19, 2012

    larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #3
    I used that many times. I did not think / know there was a Method that allows me to enumerate through all of the sub directories and those sub directories.

    I will start reading the docs to find it.

    Thanks Chown33.

    EDIT: Yep, right there in front of my face 'enumeratorAtPath:'. It works perfectly... Thanks again,
     

Share This Page