Getting Started with Core Foundation

Technology Overview

Core Foundation is a procedural C framework that is conceptually modeled on the object-oriented Foundation framework in Cocoa and that uses the abstraction of the opaque type as a procedural analog to an object. If you use the Mac OS X developer environments (Carbon and Cocoa), you can incorporate Core Foundation types in your external interfaces and so share code and data between different frameworks and libraries. Moreover, you can use many Core Foundation data types (such as arrays and strings) interchangeably with the corresponding Cocoa objects. This can help you to transition code from one application environment to another. Utilities such as command-line applications can also benefit from the features Core Foundation provides.

Core Foundation helps you to create various kinds of application by providing:

  • Opaque types that encapsulate data such as strings, dates, and locales. These opaque types help you to manipulate Unicode strings, internationalize your application, and deal with time information.

  • Opaque types that represent arrays, dictionaries, and XML property lists. These opaque types help you to deal with collections of data and to exchange data between different applications.

  • A memory management model that helps you to prevent your code from leaking.

  • A suite of utilities to support such features as plug-ins, URL resource access, and user preferences.

You can also use the associated CFNetwork Programming Guide framework for networking tasks—in particular, dealing with Bonjour and the processing of HTTP transmissions.

Core Foundation does not provide support for user interface components such as windows and menus. If you want to create applications with a graphical user interface, you should also look at Getting Started with Cocoa and Getting Started with Carbon to become familiar with those frameworks.

Start Here

To begin development with Core Foundation, read:

  • Mac OS X Technology Overview to familiarize yourself with the system architecture of Mac OS X. At a minimum, read the System Architecture chapter, so that you can understand how Core Foundation relates to the major application environments.

  • Core Foundation Design Concepts (Core Foundation) to understand the design concepts that underlie Core Foundation.

  • Core Foundation to become familiar with the latest developments in the Core Foundation APIs, documentation, and Technical Notes, and to learn about other resources related to developing with Core Foundation.

Choose a Learning Path

Becoming proficient with Core Foundation begins with learning the underlying fundamental concepts—in particular, memory management. You may also benefit from using Apple’s developer tools.

Learning the Fundamentals

The first step in learning to use Core Foundation effectively is to understand the basic principles of opaque types. A full appreciation of the memory management model that Core Foundation employs will save you from many common mistakes.

Learning About the Development Tools

To start writing Core Foundation utilities quickly, Apple recommends its integrated development environment Xcode, which integrates a number of standard UNIX development tools.

Migrating from Another Platform

If you are porting code from another environment, the following documents will provide useful information. The article Carbon-Cocoa Integration Guide also describes general porting and integration issues relevant to Core Foundation.

  • If you are porting an application from Mac OS 9, read Carbon Porting Guide to determine how to best make the transition.

  • If you are a UNIX or Linux developer, read Porting UNIX/Linux Applications to Mac OS X to learn what makes Mac OS X different from other UNIX implementations and how to port existing UNIX applications to the platform.

  • If you are porting an application from Windows, read Porting to Mac OS X from Windows Win32 API to learn the differences to expect between Windows and Mac OS X and the resources that can be useful in the porting process.

Next Steps

The Core Foundation Reference Library includes the following high-level resource pages, which can be bookmarked for easy access:

  • Guides

    Conceptual and how-to information for Core Foundation technologies.

  • Reference

    Focused, detailed descriptions in reference format for the Core Foundation API.

  • Release Notes

    Late-breaking news about new or changed features in the Core Foundation API.

  • Sample Code

    Sample applications, some of which demonstrate Core Foundation technologies. If you install the Xcode Tools CD, additional sample projects are provided in /Developer/Examples/CoreFoundation.

  • Technical Notes

    Late-breaking documents on Core Foundation issues.

  • Technical Q&As

    Programming tips, code snippets, and FAQs by Apple’s support engineers.



© 2004, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-11-07)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.