Hi, I have some problems to retreive folder names and send them as items for a ComboBox
My actual code:
NSError *errors = nil;
NSString *pathForDirectory = @"/Folder/Folder/";
NSFileManager* fileManager = [NSFileManager defaultManager];
NSArray *contentsDirectory = [fileManager contentsOfDirectoryAtPath:
pathForDirectory error:&errors];
NSArray *Directory = [NSArray arrayWithObjects:contentsDirectory];
dataFromArray = [[NSMutableArray alloc] init];
[dataFromArray addObjectsFromArray:Directory];
[self sortItemInMyComboBox:dataFromArray];
So, if NSArray *Directory is defined with static array, it works, but with the code above, the app crash with log error: Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSCFArray objectAtIndex:]: index (2147483647( or possibly larger)) beyond bounds (3)'
I guess, my mistake is how i use NSFileManager, but i've tried to others methods whitout success.
Thanks in advance, Ronan.