Created
April 15, 2012 10:10
-
-
Save yeahq/2391696 to your computer and use it in GitHub Desktop.
List File
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
//----- LIST ALL FILES ----- | |
NSLog(@"LISTING ALL FILES FOUND"); | |
int Count; | |
NSString *path; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"SomeDirectoryName"]; | |
NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL]; | |
for (Count = 0; Count < (int)[directoryContent count]; Count++) | |
{ | |
NSLog(@"File %d: %@", (Count + 1), [directoryContent objectAtIndex:Count]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment