Time for action – creating a .plist file
You could, of course, create this in any text editor, but Xcode makes it extra easy to create and edit .plist
files.
- Inside Xcode, go to New | File... and then select Resource and Property List. When asked where to save the file, choose any location you want.
- You need to decide what the Root element of your
.plist
file will be—either an Array or a Dictionary (the default) type. For Eskimo, the Root element is Array containing a series of dictionaries, each holding the data for a level in the game. - By selecting the Root element, you get a plus sign indicator right next to the Type declaration. Clicking on this plus sign will add an element to Root. You can then pick the data type for this new item. The options are Boolean, Data, Date, Number, String, and again Array and Dictionary. The last two can contain subitems in the tree, just like the Root element.
- Keep adding elements to the tree, trying to match the items in the following screenshot...