Creating Our First Property List (plist)
In the last chapter, we used a provided plist
in order to load our cuisine list. We will do the same in this chapter, but now that you are familiar with what a plist
is, we will create one from scratch together.
Tip
I use plists
all the time, from creating menus to having a file that holds app settings, like colors or social media URL. I find them very useful, especially if I need to come back later and update or change things.
Let's learn how to create a plist
from scratch. In order to create a plist
in Xcode, do the following:
Right-click on the
Model
folder inside ofLocation
and select New File.Inside of the Choose a template for your new file, select iOS at the top, and then, type Property in the filter field:
Select Property List and, then, hit Next.
Name the file, Locations, and hit Create.
You should now have a file that looks like mine:
Adding Data to Our Property List
As you learned in the previous chapter, our plist
has a Root; for this new file...