File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 47
47
name ]];
48
48
}
49
49
50
- NSArray *MPListEntriesForDirectory (
50
+ NSArray < NSString *> *MPListEntriesForDirectory (
51
51
NSString *dirName, NSString *(^processor)(NSString *absolutePath))
52
52
{
53
53
NSString *dirPath = MPDataDirectory (dirName);
54
54
55
55
NSError *error = nil ;
56
56
NSFileManager *manager = [NSFileManager defaultManager ];
57
- NSArray *fileNames = [manager contentsOfDirectoryAtPath: dirPath
58
- error: &error];
57
+ NSArray < NSString *> *fileNames = [manager contentsOfDirectoryAtPath: dirPath
58
+ error: &error];
59
59
if (error || !fileNames.count )
60
60
return @[];
61
+
62
+ SEL sortSelector = @selector (localizedStandardCompare: );
63
+ fileNames = [fileNames sortedArrayUsingSelector: sortSelector];
61
64
62
- NSMutableArray *items = [[NSMutableArray alloc ] init ];
65
+ NSMutableArray < NSString *> *items = [[NSMutableArray alloc ] init ];
63
66
for (NSString *fileName in fileNames)
64
67
{
65
68
NSString *item = [NSString pathWithComponents: @[dirPath, fileName]];
You can’t perform that action at this time.
0 commit comments