saurb
saurb

Reputation: 685

How to get file names under a given directory in iPhone?

I have some audio files saved under the Documents directory. I just want to get those file names so that I can display them in a tableview. Right now I'm using

NSArray* files = [[NSFileManager defaultManager] 
                      contentsOfDirectoryAtPath:DOCUMENTS_FOLDER error:&err];

How can I extract just the file names into an array using that returned NSArray* files Object?

Upvotes: 1

Views: 1360

Answers (1)

Vincent Gable
Vincent Gable

Reputation: 3465

Try -stringByDeletingPathExtension on each of the filenames.

Upvotes: 1

Related Questions