I’m trying to learn to use array controllers with table views and got things working with a multicolumn table and an array controller bound to an array of dictionaries. However, when I tried to do the same with an array controller bound to an array of script objects, I’m running into problems.
My ASObjC application set-up is as follows. I created a main application class called MainScript, which is run by the app delegate on start-up. MainScript has a property named taskScripts whose value is a list that will be bound to the array controller for the table. I also created a class named TaskScript with properties taskMessage, taskTime, and taskFeatures, whose values I would like to display in a three-column table. When the application is run, MainScript creates instances of TaskScript, assigns text string values to each TaskScript’s taskMessage, taskTime, and taskFeatures properties, then adds the TaskScript objects to its taskScripts list.
In MainMenu.xib, a table view with three columns corresponding to taskMessage, taskTime, and taskFeatures has been added to the application window. An array controller object is created, and its Object Controller class name attribute is set to TaskScript. The array controller is bound to MainScript with the following settings: Controller Contents → bound to MainScript, Controller Key = empty, Model Key Path = taskScripts, and Handles Content As Compound Value = on. The text cell for each of the three table columns is bound as follows: Value → bound to Array Controller, Controller Key = arrangedObjects, Model Key Path = taskMessage, taskTime, or taskFeatures depending on the table column.
When I run the application, the window with the table opens, but nothing displays in the table columns. Can you please help me understand where I am going wrong. As I mentioned, things worked well with a similar set-up except that taskScripts consisted of an array of dictionaries rather than an array of script objects.