iphone - Sorting NSDocumentDirectory by name -
i want sort nsdocumentdirectory filename folders should first name , files sorted name.
in document directory, have lots of files , folders also.
i have array like,
_filepathsarray =[[nsfilemanager defaultmanager] contentsofdirectoryatpath:_selectedpath error:nil];
thanks in advance
you can sort array alphabetically following way. not sure folders comes first.
[myarray sortusingselector:@selector(caseinsensitivecompare:)];
or
sortedarray = [anarray sortedarrayusingselector:@selector(localizedcaseinsensitivecompare:)];
Comments
Post a Comment