Possible Duplicate:
How to sort a NSArray alphabetically?
Hi all, I have an array which consist of companies name. I want to sort array alphabetically so that companies name come in alphabetic order. Please suggest me how to do this. Thanks in advance
[myArray sortUsingSelector:@selector(caseInsensitiveCompare:)];
Rams
NSArray *sortedStrings = [strings sortedArrayUsingSelector:@selector(compare:)];
Simon Lee
See this.... Alphabetical Sort
If the array consists of NSStrings
:
[companies sortUsingSelector:@selector(compare:)];
来源:https://stackoverflow.com/questions/6107725/sorting-array-alphabetically