How to establish secondary NSSortDescriptor sort key?

前端 未结 2 1080
长情又很酷
长情又很酷 2021-02-20 09:41

I have successfully sorted the data I have by my sort key lastName, but I want to know how to sort by lastName, and then by firstName. He

2条回答
  •  误落风尘
    2021-02-20 10:12

    Notice that you are passing an array of sort descriptors. Simply create another descriptor for firstname and create the array with both descriptors. They will be applied in the order of the array.

提交回复
热议问题