Possible Duplicate:
How to sort a NSArray alphabetically?
Hey I’ve looked all over this site and google for the answer to my question. I’m very new to iPhone programming and I’m figuring this question should be fairly easy to answer. In my app, I have an array that is filled with strings. I display the array in a UITableView with each string in its own cell. However, the strings are placed in a non-organized manner. Is there a way to organize an array’s strings by alphabetizing the strings? ANY help is GREATLY appreciated. Thanks in advance.
In the future, post the code you having trouble with. Your question is too vague to answer, as written. But your comment fills in enough information to imply that you are trying to sort a mutable array.
For that, you can use any of the
NSMutableArraysorting methods;Take your pick as any one of them will sort the array itself (and not produce a new array).