iphone - Copy contents of directory to an NSArray -
I have a number of images in jpg format in the folder named Wallpapers ; I have read the contents of the directory Trying to try and store them in an array using the following code:
NSFileManager * manager = [NSFileManager defaultManager]; NSArray * fileList = [Manager ContentoffEditAct Path: @ "/ Wallpaper" Error: NULL];
but it is not working. I am unable to bring them in the array Can anyone tell me what is wrong with it?
You must specify the full path to the directory. I agree that your folder is in the wallpaper
document directory.
NSFileManager * fileManager = [NSFileManager defaultManager]; NSString * documentsPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, Yes) objectAtIndex: 0]; NSString * extractDirPath = [document path stringbapping string: @ "/ wallpaper"]; NSArray * extractsList = [DirectoryAct path for file manager content: extractDirPath error: zero];
Comments
Post a Comment