Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can one extend CoreFoundation using Obj-C?



I would like to add a few new CoreFoundation data types for some common code. I explicitly want to have CFRetain() / CFRelease() / CFGetTypeID() calls work. The Docs on "Toll-Free Bridging" hint that I might be able to do this (they say that CoreFoundation objects can be swapped with Cocoa NS counterparts or vise versa), but I would like to be sure that this is true and should remain true in the future.

I would then export C APIs that would wrap around the Obj-C functions that did the actual work, thus following the basic precepts of CF. This would include my own CFGetMyTypeID() functions as appropriate. This would be along side the true Obj-C APIs for Cocoa projects to access directly, just skipping the Obj-C interface code when not available in the build environment.

I want to have a unique CFTypeID that my class exports that would be unique in the same manner as these already are in the CoreFoundation world, no better. And I want my class to be retainable / releaseable using the CoreFoundation retain / release APIs. I do not desire any more compatability than this.

I can create my own equivalent APIs using C++, but it would be much cleaner for my design to be able to work by extending CF instead.

Can anyone in the know comment if this is possible?

TIA,
brian

_____________________________________________________
Brian Cave <mailto:email@hidden>




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.