Sort array of dictionary

后端 未结 3 852
無奈伤痛
無奈伤痛 2020-12-21 11:25

I need to sort an array of dictionaries in the following ways. The array contains dictionaries with the following format:

[{
  fecha = \"09:54:51\";
  \"nomb         


        
3条回答
  •  感动是毒
    2020-12-21 12:06

    Try this:

    var descriptor: NSSortDescriptor = NSSortDescriptor(key: "numero", ascending: true)
    var sortedResults: NSArray = results.sortedArrayUsingDescriptors([descriptor])
    

提交回复
热议问题