Skip to content

Instantly share code, notes, and snippets.

@Azuritul
Created February 4, 2012 04:40
Show Gist options
  • Save Azuritul/1735379 to your computer and use it in GitHub Desktop.
Save Azuritul/1735379 to your computer and use it in GitHub Desktop.
Walking directory
/*
* Excerpt from :
* http://rosettacode.org/wiki/Walk_a_directory/Recursively#Objective-C
*/
NSString *dir = NSHomeDirectory();
NSDirectoryEnumerator *de = [[NSFileManager defaultManager] enumeratorAtPath:dir];
NSString *file;
while ((file = [de nextObject]))
if ([[file pathExtension] isEqualToString:@"mp3"])
NSLog(@"%@", file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment