First, you can put NSvalue in CFMutableDictionary as-is, so the answer will be "use NSValue". But I guess the rest of your question is "without using any Cocoa objects." In this case, just create a non-persistent CFMutableDictionary, and you can put any pointer in it. See โDefining Custom Callbacksโ for some sample code. I use them a lot.
Remember that these should still be pointers, so you have to allocate your structures on the heap, not on the stack. And that means memory management is now your problem. Of course, you can create your own set of callbacks that do what you want, so if you use boost or something else with your own reference counting system, you can still implement this with CFMutableDictionary.
And of course, you can replace the structure with a small data object. This is usually much simpler. But different problems require different solutions.
source share