This is from: http://www.cnblogs.com/geraldzhang/archive/2011/08/24/2152121.html
In the cocoa, nextstep, and gnustep programming frameworks of Mac OS X, A property list file is a file used to store serialized objects. The property list file extension is. PlistTherefore Plist file.
Plist files are usually used to store user settings or bundle information. This function is provided by resource branches in legacy Mac OS.
Using the property list interface in Mac OS and core Foundation, we can convert between hierarchical objects and XML files. We can store the XML file and then read it as an object. Here we will discuss the property list and their forms, and how to use them during programming.
Here I would like to mention nsuserdefault, which is actually stored in the form of property list, but it has limitations. For example, nscolor and nsfont types cannot be directly stored, we must convert them to the nsdata type for storage.ArticleLet's talk about this issue in detail.
Let's get started.
In the programming process, we can create a plist in the project to store some variables. The specific operation steps are file-New-Mac OS X-resource-property list. In the project, we can write data in XML or source code format. For example, the original plistCodeThe format is the same as the XML below.
XML Code
- <? XML Version = "1.0" Encoding = UTF-8" ?>
-
- <! Doctype plist public "-// Apple // DTD plist 1.0 // en" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- plist version = " 1.0 " >
- <Dict>
- < Key > Name </ Key >
- < String > John doe </ String >
- < Key > Phones </ Key >
- <Array>
- < String > 408-974-0000 </ String >
- < String > 503-333-5555 </ String >
-
- </Array>
- dict >
- </Plist>