Re: Help with NSPointerArray and NSMapTable
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sep 21, 2009, at 20:54, Nat! wrote: > I would try NSPointerFunctionsOpaqueMemory (shouldn't retain/release > or do weird GC stuff on the value), > + NSPointerFunctionsIntegerPersonality (use value as hash and > equality) and pass in the integer casted in as void *. > > If that's right, then I guess the documentation is sufficient ;) > > Ciao > Nat! Thanks. The problem I have with the docs is that it is not obvious to me what the "value" is. Is this the pointer itself, or the target of the pointer? If it's the pointer, they should call it the pointer, otherwise they should explain which value they're talking about. For instance, if you are right, than for NSPointerFunctionsIntegerFunctionality the value is the pointer itself (which actually isn't a pointer), while for NSPointerFunctionsStructPersonality, the struct is the target of the pointer. Quite frankly, that distinction is not clear for me by reading the docs. Apart from this, the 64-bit docs warn against type-casting an NSInteger as a pointer, but that seems to be exactly what NSPointerArray expects me to do? If they go against their own docs I really think they should be more clear. Christiaan