Collection callbacks and toll free bridging

Christiaan Hofman cmhofman at gmail.com
Wed Apr 2 07:25:23 PDT 2008


Hi all,

I have some questions about how toll free bridging handles callbacks  
for collections. I've searched the docs but came out empty. Basically  
I have the following 2 questions:

1. Are Cocoa accessors doing anything besides some checking and  
wrapping CF functions?
2. What callbacks are used by collections initialized using Cocoa?

Let me make this a bit more explicit for the example of  
CFMutableDictionaryRef/NSMutableDictionary. NSMutableDictionary is  
documented to copy the keys. So a more concrete version of my question  
is: are the keys copied by the Cocoa methods, or by the CF key  
callbacks?

Context: I need a dictionary for keys that do not conform to  
NSCopying. So can I use just use CFDictionaryCreateMutable to create  
the dictionary and then use Cocoa methods for the rest?

Christiaan



More information about the MacOSX-dev mailing list