Sunday, 8 September 2013

Getting number of files in directory IOS

Getting number of files in directory IOS

How can I get the number of files in the whole IOS directory with the
extension .png, .ext, .annotate...?? I tried this:
NSFileManager * filemgr = [NSFileManager defaultManager];
NSArray * filelist = [filemgr directoryContentsAtPath:yourPath error:nil];
int count = [filelist count];
NSLog("%d", count);
but it gives the total count, not just the one of the files with the
extension

No comments:

Post a Comment