Sort NSDictionary

前端 未结 3 1236
名媛妹妹
名媛妹妹 2021-01-28 06:25

I got NSDictionary with pairs like :

Key -> Value:
@\"home\" -> @\"blue\"
@\"family\" -> @\"green\"
@\"work\" -> @\"red\"
         


        
3条回答
  •  走了就别回头了
    2021-01-28 06:45

    You can't sort an NSDictionary. If you want , you could create an object to hold the key and value in it, then add to an array and use a sort descriptor to sort on the key field.

提交回复
热议问题