I want the user to select any file present in her/his iPhone so that it’s used as an e-mail attachment. For this purpose, I want to show the list of all files and folders pr
You can use NSDirectoryEnumerator via NSFileManager.enumeratorAtPath
From the docs:
NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"];
NSFileManager *localFileManager=[[NSFileManager alloc] init];
NSDirectoryEnumerator *dirEnum =
[localFileManager enumeratorAtPath:docsDir];
NSString *file;
while ((file = [dirEnum nextObject])) {
if ([[file pathExtension] isEqualToString: @"doc"]) {
// process the document
[self scanDocument: [docsDir stringByAppendingPathComponent:file]];
}
}