Getting data from the property list

Our next task is to get the data from the XML and turn it into an array of Person objects that we can assign to the content property of personArrayWrapper. We can break this down into a few discrete steps:

  1. Get the location of the People.plist file within the app's main bundle.
  2. Decode the XML data in that file.
  3. Parse that data to create an array of Person objects.
  4. Assign that array to the personArrayWrapper property of ViewController.

In order to make use of some of the data we get from the property list, we will need a dictionary of type [String: NSColor], which we will use to convert the XML's String representation of a color to an NSColor object. Rather than bloat the ViewController with this code, ...

Get Mastering macOS Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.