Core Foundation Property List Services

Many applications require a mechanism for storing information that will be needed at a later time. For situations where you need to store small amounts of persistent data, less than a few hundred kilobytes, Core Foundation provides Property List Services. Property lists--frequently referred to as "plists"--offer a uniform and architecture-independent means of organizing, storing, and accessing data for Carbon and Mac OS X applications.

Property lists organize data into named values and lists of values using several Core Foundation types: CFString, CFNumber, CFBoolean, CFDate, CFData, CFArray, and CFDictionary. These types give you the means to produce data that is meaningfully structured, transportable, storable, and accessible, but still as efficient as possible. The property list programming interface allows you to convert hierarchically structured combinations of these basic types to and from standard XML. The XML data can be saved to disk and later used to reconstruct the original Core Foundation objects. Note that plists should be used for data that consists primarily of strings and numbers because they are very inefficient when used with large blocks of binary data.

It is important to understand property lists because they are used frequently in Mac OS X and appear in the Core Foundation programming interface. For example, the Mac OS X Finder--through Bundle Services--uses plists to store file and directory attributes. Core Foundation Bundle Services and URL Access Services use plists as well.

If you are looking for a way to implement user or application preferences, however, there is no need to do this yourself using plists. Core Foundation provides a programming interface specifically for this purpose. See the chapter "Core Foundation Preference Services," for more information.

Header Files:

CFPropertyList.h

Core Foundation Property List Services Concepts

Core Foundation Property List Services Tasks


© 1999 Apple Computer, Inc. (Last Updated 02 November 99)