CFMutableDictionary vs. NSMapTable
CFMutableDictionary vs. NSMapTable
- Subject: CFMutableDictionary vs. NSMapTable
- From: Bill Bumgarner <email@hidden>
- Date: Mon, 9 Sep 2002 09:25:42 -0400
I need to create a set of maps between integer keys and either objects
or integer values, depending on context (though any one given
dictionary/map will only have values of a single type, obviously).
I have long used NSMapTable's API in this context, but was curious if
CFDictionary's API is now preferable. Looking further at
CFDictionary, it doesn't explicitly document a case where a
non-CFTypeRef is used as the key or values. At the same time, the key
and value callback functions appear to do what is needed to use integer
key/values if you simply pass in NULL for the structure references.
However, given that the fact that the number of bits in an (int) is
only coincidentally the same as the number of bits in (void *) -- (void
*) being the type of all key and value parameters to the CFDictionary
APIs -- it would appear that CFDictionary is very explicitly only
designed to handle pointer types.
As such, I'm sticking with NSMapTable.
Correct line of thinking or did I miss something?
b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.