Hi all,
I’ve been running into a problem with array controllers and bindings for a while now and am not sure what the best approach is to prevent this.
The main question is how you should replace an object within an arraycontroller’s content without it breaking the bindings to properties of the object.
Imaging an array controller that manages a number of custom objects of type “Product".
The array controller itself is the source (via bindings) for a tableview and the tableview in turn displays the custom “price" property of “Product” (also with bindings).
That all works fine, no problems at all, but the problems start when i need to update the product object that’s currently selected (for example, to update all properties).
I now can replace the object directly in the array controller’s content array using replaceObjectAtIndex:withObject: but that doesn’t refresh the array controller.
I can also add the object to the array controller itself but that leaves the old object still in there and is also complex keeping the correct product selected.
Does anyone have any pointers in the official way to do this as I’m currently working from one work around to the next.
Thanks!