So, I have a table connected to an array controller. I want to replace the selected row of data with some new data. If I replace it in the property it doesn’t refresh the table. I’m sure there is a way to tell the table to replace the selected row with the new data but all I can find is commands to add or remove rows from any array controller.
I’m not adding an entry… I’m changing one that already exists. Since I can’t replace/modify it, I am changing the data in the list property in the script which apparently doesn’t automatically update the array/table automatically or not immediately. Hence, the reload command.
At this point that’s my approach because I’ve run out of time to play around with this any more. Perhaps if I get bold later I will try to delete and add the replacement data in it’s former position.
What are you using exactly? It’s a bit unclear because we don’t have any idea of the way your data is coded (the Model), nor the way it is represented in the interface (the View). So the role of your Controllers is hard to guess.
Are you using a Applescript list? A list of what? values or records?
In order your controller to be aware of your list’s changes, you have to inform the notification system that something has changed into your list. For this, you must put «my» before the name of the object that is changing. Say you want to modify the line 4 of your table view, you have to do:
set item 5 of my dataList to newValue – value is the data you store in a line. NSArrays begin at 0, AS list at 1.
Try this. The controller should reflect your changes.