I have saved many files in a folder in the documents directory. This is the path to one of them:
/var/mobile/Applications/120FD973-C902-405E-A645-B1651904CE9B/Documents/1127029/BusinessCard2258009241.card
I want to list the files in the folder (1127029), and I tried this:
NSFileManager *fManager = [NSFileManager defaultManager];
NSString *item;
NSArray *contents = [fManager contentsOfDirectoryAtPath:[NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/%d", FolderNumber]] error:nil];
// >>> this section here adds all files with the chosen extension to an array
for (item in contents){
if ([[item pathExtension] isEqualToString:@"card"]) {
...
But it doesn't work