Introduction
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 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.
To learn about opaque types, read Opaque Types.
To learn about memory management, read Memory Management Programming Guide for Core Foundation.
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.
To learn more about Apple’s Xcode Tools, read Mac Technology Overview.
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 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:
Conceptual and how-to information for Core Foundation technologies.
Focused, detailed descriptions in reference format for the Core Foundation API.
Late-breaking news about new or changed features in the Core Foundation API.
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
.Late-breaking documents on Core Foundation issues.
Programming tips, code snippets, and FAQs by Apple’s support engineers.
Copyright © 2004, 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-11-07