Skip navigation.
 
mlbind tableview to arraycontroller
FROM : Hans van der Meer
DATE : Sat Feb 23 22:02:00 2008

Step by step I try to master the kvc-kvo-bindings matter.
Now I have:
    NSArrayController bound to an NSArray in a class in my program
    NSTableView bound to the NSArrayController as follows:
      columns of the table are bound to fields in the objects held by 
the array.

The problem I am wrestling with: how to see the tableview reacting to 
changes in the array.

After the discussions in this group I refrained from explicitely 
invoking kvo on the array in my class. It turns out the 
NSArrayController does get the changes, even if these are not at once 
visible in the tableview.
But if I touch the column header in the tableview then all of a sudden 
the contents becomes visible. If in IB I select off for the 'enabled' 
state in the 'control' part of the table view attributes, then the 
visual updating does not occur.
One further point to note: clicking in the first column did not update 
the view, though I cannot see a difference in binding with the other 
columns!

My conclusion therefore: obviously am I doing something wrong in the 
interaction between the tableview and the arraycontroller. The 
controller apparently has received new content but not signalled that 
to the tableview; the latter changing when prodded into action by the 
click in the column header.

Someone who knows what exactly is going on? I have read the XCode 
documentation in the "Cocoa Binding Programming Topics" but could not 
solve it from that text.

Hans van der Meer

Related mailsAuthorDate
mlbind tableview to arraycontroller Hans van der Meer Feb 23, 22:02
mlRe: bind tableview to arraycontroller Adam Gerson Feb 24, 01:40