I have some folders and subfolders in my documents directory how can i get an array with the files in the directories and subdirectories not the folders just the files.
here is my code so far and it's working if no folders and subfolders exist
//getting all the files on documents folder in an array.
NSError * error;
NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:&error];