NSMapTable and NSMutableDictionary differences

前端 未结 4 833
广开言路
广开言路 2020-12-09 19:17

Is an NSMapTable the same as an NSMutableDictionary except for allowing keys to be pointers?

Does it differ in memory management?

4条回答
  •  囚心锁ツ
    2020-12-09 19:47

    More or less, it has some additional options that are primarily relevant if you use Garbage Collection (which is sort of deprecated, I guess). If you don't use Garbage Collection, the memory management requirements are the same.

    Another difference is that NSMapTable can optionally use pointer equality for hashing.

提交回复
热议问题