Introduction to Property List Programming Topics for Core Foundation

Explains how to use structured, textual representations of data in Core Foundation.

Organization of This Document

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 property lists 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.

Property lists are used frequently in OS X. For example, the OS X Finder—through bundles—uses property lists to store file and directory attributes. Core Foundation bundles and URL objects use property lists as well. User and application preferences also use property lists, however, you should not use the CFPropertyList API to read and modify preferences. Core Foundation provides a programming interface specifically for this purpose—see Preferences Programming Topics for Core Foundation for more information.

This document describes the property list structure, and use of XML tags and specifics about numbers, and contains examples on creating, saving, and restoring property lists.

Property List Structure and Contents

Creating Property Lists

Saving and Restoring Property Lists

Using Numbers in Property Lists

Property List XML Tags

Next

Copyright © 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-04-23