I am wondering how to get the NSFileManager list to display the results in the order in which they are sorted. By default, this code is:
NSFileManager *fileManager = [[NSFileManager alloc] init];
NSError *foundErrors = nil;
NSArray *contentsOfDockDirectory = [fileManager contentsOfDirectoryAtPath:@"/Users/me/Desktop error:&foundErrors];
Creates an NSArray that lists it in this type of order: 1, 100, 2, 200, etc. However, the Finder shows the correct sort, so this is: 1, 2, 100, 200, etc.
Is there a way to sort NSArray or NSFileManager to have a list in that order?
source
share