Created
June 15, 2016 19:45
-
-
Save rojaster/05e07a917eaefa4e3898cd10806fdf29 to your computer and use it in GitHub Desktop.
function thats prints files by their extension pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void printFilesByExtensionPattern(NSString* path, NSString* pattern) | |
{ | |
NSString *filename; | |
int index = 0; | |
for(filename in [[NSFileManager defaultManager] enumeratorAtPath: [path stringByExpandingTildeInPath]]) | |
{ | |
if([[filename pathExtension] isEqualToString: pattern]) | |
{ | |
++index; | |
NSLog(@"%@ : %d", filename, index); | |
} | |
} | |
} // printFilesByExtensionPattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment