I’m calling a C method which returns a pointer or ‘handle’ to a resource. I just need to hold the void* in order to pass it in again later.
In .NET, I might use IntPtr. The only different between IntPtr and just an int–other than making the pointer a more strongly typed variable–is that IntPtr is automatically the size of the platform (32 or 64 bits). I’m looking for the same thing in Objective-C.
Is there some equivalent way to wrap a pointer in Objective-C?
Have you looked at NSValue’s
+ (NSValue *)valueWithPointer:(const void *)aPointer?