I want to get all the filenames in my application's documents
folder, and place them in an NSMutableArray
. Nothing more, nothing less.
There is a convenient method in NSFileManager
:
NSFileManager *fileManager = [[NSFileManager alloc] init];
NSArray *files = [fileManager contentsOfDirectoryAtPath:documentsDirectory
error:nil];
...
[fileManager release];
As of ARC you can of course drop the release statement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With