Sort NSDictionary

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

I got NSDictionary with pairs like :

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


        
3条回答
  •  伪装坚强ぢ
    2021-01-28 06:47

    NSDictionary is not an ordered collection, however you can sort its keys using comparators like keysSortedByValueUsingComparator, keysSortedByValueUsingSelector.

提交回复
热议问题