Property list
From Wikipedia, the free encyclopedia
Property List | |
---|---|
File extension: | .plist |
Developed by: | Apple Computer and GNUstep, formerly NeXT |
Type of format: | Serialization of dictionary objects. |
In the Mac OS X Cocoa, NeXTSTEP, and GNUstep programming frameworks, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as plist files. Property lists are parsed with the NSPropertyListSerialization class. A property list file can only contain Core Foundation or Foundation Kit objects, as the library does not know how to serialize any other type of object.
In practical terms they are often used to store a user's settings (similar to the function of the Windows registry on Microsoft Windows). They are also used to store information about bundles and applications, a task served by the resource fork in the old Mac OS.
Contents |
[edit] Representations
Since the data represented by property lists is somewhat abstract, the underlying file format can be implemented many ways. Namely, NeXTSTEP used one format to represent a property list, and the subsequent GNUstep and Mac OS X frameworks introduced differing formats.
[edit] NeXTSTEP
Under NeXTSTEP, property lists were designed to be human readable and edited by hand, serialized to ASCII in a syntax somewhat like a programming language.
Strings were represented as:
"This is a plist string"
Binary data was represented as:
< [hexadecimal codes in ASCII] >
Arrays were represented as:
( "1", "2", "3" )
And dictionaries were represented as:
{ "key" = "value"; ... }
One limitation of the original NeXT property list format is that it could not represent an NSValue (number, boolean, etc) object.
[edit] GNUstep
GNUstep adopts the NeXTSTEP format, with a few additions. First, it now supports NSValue objects (which are represented as plain ASCII), and second, it supports NSDate objects (which are serialized as <*DYYYY-MM-DD HH:MM:SS timezone>)
GNUstep can also read and write property lists in the formats used by Mac OS X.
[edit] Mac OS X
While the Mac OS can also read the NeXTSTEP format, Apple sets it aside in favor of two new formats of its own.
In Mac OS 10.0, the NeXTSTEP format was deprecated, and a new XML format was introduced, with a public DTD defined by Apple.
Since XML files, however, are not the most space-efficient means of storage, version 10.2 introduced a new format where property list files are stored as binary files. Starting with version 10.4, this is the default format.
The plutil utility (introduced in version 10.2) can be used to check the syntax of property lists, or convert a property list file from one format to another.
For the XML format, the tags and related Foundation classes are as follows:
Class name | XML Tag |
---|---|
NSString | <string> |
NSNumber | <real>, <integer>, <true />, or <false /> |
NSDate (GNUStep) |
<date> |
NSData | <data> |
NSArray | <array> |
NSDictionary | <dict> |
The defaults utility, as well as the third-party GUI program PrefEdit, can be used to manipulate plist files used for storage of preferences (also known before OS X as defaults, hence the name) on the command line via their preferences domain, whereas Property List Editor (part of the SDK) can be used used to edit any plist file (including those used for preferences).
[edit] External links
- The plist manual page at developer.apple.com
- Property List Programming Guide for Cocoa
- NSPropertyListSerialization class documentation from the GNUstep project
- OpenStep plist API from Sun Microsystems
Applications
Address Book • Automator • Calculator • Chess • Dashboard • Dictionary • DVD Player • Finder • Front Row • Grapher • iCal • iChat • iSync • iTunes • Mail • Photo Booth • Preview • QuickTime Player • Safari • Sherlock • Stickies • TextEdit
Utilities
Activity Monitor • AirPort Admin Utility • Audio MIDI Setup • Bluetooth File Exchange • BOMArchiveHelper • Classic • ColorSync Utility • Console • Crash Reporter • DigitalColor Meter • Directory Access • DiskImageMounter • Disk Utility • Font Book • Grab • Help Viewer • Image Capture • Installer • Internet Connect • Keychain Access • Migration Assistant • NetInfo Manager • Network Utility • ODBC Administrator • Printer Setup Utility • Software Update • System Preferences • System Profiler • Terminal • Universal Access • VoiceOver • X11
Technology & User interface (future features italicized)
⌘ • ⌥ • Apple Advanced Typography • AppleScript • Aqua • ATSUI • Audio Units • Bonjour • Boot Camp • Carbon • Cocoa • ColorSync • Core Animation • Core Audio • Core Data • Core Foundation • Core Image • Core Video • CUPS • Darwin • Exposé • FileVault • icns • Inkwell • I/O Kit • Keychain • Mach-O • OpenGL • Preference Pane • plist • Quartz • QuickTime • Rosetta • Smart folders • Spaces • Spotlight • Time Machine • Uniform Type Identifier • Universal binary • WebKit • Xgrid • XNU