iphone: how do I obtain a list of all files with a given extension on the app's document folder?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-06-15T17:18:08Z Indexed on 2010/06/15 17:22 UTC
Read the original article Hit count: 415

Filed under:
|
|

I have saved all my files using something like this

NSString *fileName = [NSString stringWithFormat:@"%@.plist", myName];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:fileName];

[myDict writeToFile:appFile atomically:YES])

//where myDic is a dictionary containing the value of all parameters I would like to save.

All these files were saved with the .plist extension. The same directory contains several JPG and PNG files.

Now, how do I retrieve the list of all .plist files on that directory?

thanks for any help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk