I have an iPhone app that searches a folder, collates an an array of all the audio files, and lets them be played back. The problem is that if there is a subfolder within the folder I am searching, it will just skip over it/not go into its contents.
My code is as follows:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:documentsDirectory];
NSString *pname;
while (pname = [direnum nextObject])
{
[musicArray addObject:[pname stringByDeletingPathExtension]];
}
What I want to do is continue to search its subfolders, how would I go about doing that?