I need to look for files with a specific type and put them in an array. I’ve found code like this:
NSArray* pdfs = [[NSBundle mainBundle]
pathsForResourcesOfType:@"pdf" inDirectory:nil];
But this code accesses my application bundle, not the Documents directory.
I also found this code for getting the Documents directory:
NSString* doc = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);;
However, I just don’t get how to get the path for a pdf file inside the Documents folder. I already tried to change the values of the parameters for inDirectory: in pdfs to be @"~/Documents" and still it can’t change the directory path.
To get the array of files at document directory :