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:
- Get the location of the People.plist file within the app's main bundle.
- Decode the XML data in that file.
- Parse that data to create an array of Person objects.
- 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, ...