Lesson 22
Property Lists
A property list is an XML key-value store that allows applications to store small amounts of data locally. Property lists are best suited to storing small amounts of data (less than a few hundred kilobytes). It is quite common for applications to use property lists to store application configuration information, such as server addresses and URLs.
Creating Property Lists
A property list can be created using the property list editor, or programmatically. The GUI property list editor that is integrated with XCode displays a property list file as a hierarchy of nodes and elements, all contained under a root node (see Figure 22.1). The root node can be either an array or a dictionary.
To create a property list, add a new file to the project and select Property List from the iOS Resource section in the file options dialog box (see Figure 22.2).
This will add an empty property list file to your project, with a single dictionary element called Root (see Figure 22.3).
To add a new entry to the property list, select the parent node and select Editor Add Item (see Figure 22.4).
The default data type ...
Get Swift iOS 24-Hour Trainer now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.