Xcode IPhone SDK - How to Get All File Names in Documents

I want to get all the file names in my documents folder and put them in NSMutableArray . Nothing more, nothing less.

+7
source share
1 answer

NSFileManager has a convenient method:

 NSFileManager *fileManager = [[NSFileManager alloc] init]; NSArray *files = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:nil]; ... [fileManager release]; 

As with ARC, you can, of course, refuse the release statement.

+11
source

All Articles