ios - Load file string names into an array from Documents Directory -


I want to add a list of files in the Documents folder in an array of strings. It is not certain how to do this, this is what I have done so far. I only want to load the files, in which the file contains the word 'bottom' in the array. How do I do this exactly?

NSArray * Path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, Yes); NSString * Document Directory = [Path ObjectExtends: 0]; NSFileManager * fileMan = [[NSFileManager alloc] init]; NSArray * files = [fileman contentoff directoryAct Path: document directory error: zero]; For (Int i = 0; i & lt; files.count; i ++) {} NSString * path = [Documents directory Stringbaping path Kmpenent: [NSString rangeOfString: @ "down"]]; // This is the orientation of the file STRING names NSArray * bottomArray = [NSArray arrayWithOrbjects: @ "below 6D08B918-326D-41E1-8A47-B92F80EF07E5-1240-000005EB14009605.png", @ "bottom837C95CF-85B2-456D-8197-326 A 637F3A5B-6021-0000340042C31C23.png ", zero];

You each file will check the exact in the files array:

  NSFileManager * fileMan = [NSFileManager defaultFileManager]; NSArray * files = [fileman contentoff directoryAct Path: document directory error: zero]; NSMutableArray * bottomArray = [NSMutableArray array]; (NSString file * file) {if ([file rangeOfString: @ "bottom"]. Location! = NSNotFound) {[bottomArray addObject: file]; }}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -