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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -