Accessing objects in NSMutableDictionary by index

前端 未结 2 1261
忘掉有多难
忘掉有多难 2021-01-30 02:06

To display key/values from an NSMutableDictionary sequentially (in a tableview), I need to access them by index. If access by index could give the key at that index, I could th

2条回答
  •  离开以前
    2021-01-30 02:55

    you can get an array of all the keys with the allKeys method of the dictionary; and then you can access the array by index. however, a dictionary by itself does not have an inherent ordering, so the ordering of the keys you get before and after a change to the dictionary can be completely different

提交回复
热议问题