How can I sort an NSMutableArray alphabetically?

后端 未结 6 720
迷失自我
迷失自我 2020-12-08 05:17

I want to sort an NSMutableArray alphabetically.

6条回答
  •  生来不讨喜
    2020-12-08 05:39

    Maybe this can help you:

    [myNSMutableArray sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES],[NSSortDescriptor sortDescriptorWithKey:@"lastName" ascending:YES]]];
    

    All is acording to NSSortDescriptor...

提交回复
热议问题