How can I sort strings in NSMutableArray into alphabetical order?

后端 未结 4 706
暖寄归人
暖寄归人 2020-12-24 11:26

I have a list of strings in an NSMutableArray, and I want to sort them into alphabetical order before displaying them in my table view.

How can I do tha

4条回答
  •  梦毁少年i
    2020-12-24 11:44

    For me this worked....

    areas = [areas sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
    

    Here areas is NSArray. I hope it helps someone.

提交回复
热议问题