Cocoa methods that return CF objects

Christiaan Hofman cmhofman at gmail.com
Fri Jul 4 02:09:03 PDT 2008


On 4 Jul 2008, at 8:44 AM, mmalc Crawford wrote:

>
> On Jul 3, 2008, at 2:11 AM, Christiaan Hofman wrote:
>
>> AFAIK, CFType (= CoreFoundation "root class") is toll free bridged  
>> to NSObject. This means that you can send any valid NSObject method  
>> to a CoreFoundation object, and v.v. pass any Cocoa object to a  
>> CoreFoundation function that accepts a CFType (s.a. CFRetain(),  
>> CFRelease()).
>> However I am not 100%, and I've never been able to find this in the  
>> docs. I believe this is an omission in the docs.
>>
> <http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Articles/InterchangeableDataTypes.html 
> >
>
> mmalc

Yes, but also this document does tell me the relevant bit of what I'd  
want to know. I am pretty sure it's incomplete, as I'm sure any  
function accepting CFType (and that's more than CFRelease and  
CFRetain) can accept also any Cocoa object (NSObject). Otherwise the  
standard collection callbacks would break and, if I'm not mistaken,  
those are used by Cocoa's collection classes.

Christiaan



More information about the MacOSX-dev mailing list