NSMapTable with pointer keys ?
NSMapTable with pointer keys ?
- Subject: NSMapTable with pointer keys ?
- From: Guillaume Laurent <email@hidden>
- Date: Thu, 27 Mar 2008 16:24:06 +0100
Hi all,
I need to build a map of NSObjects indexed by void* pointers.
Apparently the right way to do this is to use NSMapTable with the
appropriate options :
[NSMapTable mapTableWithKeyOptions:NSMapTableObjectPointerPersonality
valueOptions:NSMapTableStrongMemory]
(reading the doc for NSMap, I figured these are the right options)
However, when trying to fetch an object with a void* key to check for
its presence (using the C api as recommended)
NSMapGet(myMap, aKey);
I get an instant crash and looking at the stack trace, it's because
aKey is being sent an ObjC message, to which it will hard time
replying since it's not an NSObject in the first place.
What am I missing here ?
Thanks for any hints,
--
Guillaume
http://telegraph-road.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden