Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

Core Foundation Overview

Core Foundation provides the fundamental data types and essential services that underlie both the Cocoa and Carbon environments on Mac OS X. To accomplish this, Core Foundation defines a set of C-based programming interfaces derived conceptually from the Cocoa Foundation framework. Implementing a simple object model in C, Core Foundation defines opaque types that encapsulate data and functions as system-managed objects. The Core Foundation interfaces are designed to be more object-oriented than pure C data structures, so the opaque types in Core Foundation operate seamlessly with Cocoa Foundation interfaces. These abstractions also make possible a large degree of operating-system independence as well as code and data sharing between applications. With Core Foundation, you get solid interfaces built on a stable core to help you deliver world-class products on Mac OS X.

The Core Foundation interfaces are organized into a framework that provides fundamental software services to applications, runtime environments, and system frameworks. You can easily build cross-platform applications that share code and data seamlessly among frameworks, libraries, and applications across different environments. For example, Core Foundation includes types that encapsulate strings, dates, and locales, so you can manipulate Unicode strings, deal with time conversion, and internationalize your application. Core Foundation also offers a memory management model, abstractions for common data types, and a suite of utilities such as plug-in support, XML property lists, URL handling and networking, and preferences.

Core Services is the Mac OS X system layer that lies immediately above the core operating system and below the services, frameworks, and libraries used in application development. A subsystem of Core Services, the Core Foundation framework offers most of the low-level features in Core Services for developing both Cocoa and Carbon applications, making operating-system independence and code and data sharing possible.

Core Foundation also provides "toll-free bridging" between many of its types and the Cocoa Foundation framework, giving you the ability to substitute Cocoa objects for Core Foundation objects in function parameters and vice versa. Core Foundation enables Cocoa and Carbon applications to interact seamlessly, sharing information through copy and paste, drag and drop, and other services.

Through its CFString objects, Core Foundation facilitates easy, robust, and consistent internationalization across all Mac OS X programming interfaces. A CFString instance represents an array of 16-bit Unicode characters. A CFString object is flexible enough to hold megabytes worth of characters, and yet simple and low level enough for use in all programming interfaces that communicate character data.

Core Foundation provides date and number types that abstract time utilities and offer facilities for converting between absolute and Gregorian measures of time. In addition, non-Carbon applications can take advantage of inter-process notification and run-loop services.

For memory management, Core Foundation has several built-in features that help you write code that doesn't leak. These features include allocators, reference-counting, and an object ownership policy.

Core Foundation provides rock-solid fundamental building blocks for applications and low-level system services across the multiple environments supported in Mac OS X. Designed for use and reuse, the programming interfaces in Core Foundation help your applications run smoothly on Mac OS X, offering advanced features such as a plug-in architecture, protected memory, a preferences-settings mechanism, and code and data sharing. You can deliver the innovative and easy-to-use applications that Apple is famous for, knowing that this dependable infrastructure lies beneath.

For news, updates and links to other ADC content related to Core Foundation on Mac OS X, return to the Core Foundation topic page.

Updated: 2007-10-26