Quantcast
Channel: User Sefran - Stack Overflow
Viewing all articles
Browse latest Browse all 36

Problem in getting all the files/dirs in a dir with contentsOfDirectoryAtPath

$
0
0

I have a zip file that I unzip it in a directory 'extract' under the Documents directory (the dir and its content is properly created). Then I would to do some stuff on each item in the new dir, dipendently if it's a file or a dir. I use the contentsOfDirectoryAtPath method of the NSFileManager.
The problem is that the array extractedItems returns always null and I don't know what I'm wronging.

NSString *dirnameForUnzippedData = [[NSString alloc] initWithString:@"extract"];NSString *dirpath = [documentsDirectory stringByAppendingPathComponent:dirnameForUnzippedData];NSFileManager *fileManager = [NSFileManager defaultManager];NSArray *extractedItems = [fileManager contentsOfDirectoryAtPath:dirnameForUnzippedData error:NULL];for (NSString *item in extractedItems) { ... }

Viewing all articles
Browse latest Browse all 36

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>