Sort NSDictionary

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

I got NSDictionary with pairs like :

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


        
3条回答
  •  遥遥无期
    2021-01-28 06:57

    You can access the keys in a sorted order with method like keysSortedByValueUsingComparator, keysSortedByValueWithOptions or keysSortedByValueUsingSelector. But by definition a NSDictionary itself has no notion or order.

提交回复
热议问题