Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created January 2, 2013 20:10
Show Gist options
  • Select an option

  • Save codeswimmer/4437521 to your computer and use it in GitHub Desktop.

Select an option

Save codeswimmer/4437521 to your computer and use it in GitHub Desktop.
iOS: How To Get A List Of Files In A Directory
This example below list down all files inside the application resource.
NSString *documentsDirectory = [[NSBundle mainBundle] resourcePath];
NSError *err;
NSArray *directoryContentArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:&err];
NSLog(@"%@", directoryContentArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment