Thanks for the reply - that sounds similar to what I tried before where I hooked in to the dataCellForTableColumn and willDisplayCell methods, but they are not updated when the underlying data is changed, which would presumably mean that somewhere I would have to set up KVO for each value that was displayed, so that I can force an update of the cell, and remove the KVO if a row is removed from the underlying data - something I don't need to do when it is bound through the table column. Am I understanding this correctly?
Regards Gideon On 18/07/2010, at 4:41 PM, Quincey Morris wrote: > On Jul 17, 2010, at 23:21, Gideon King wrote: > >> [[resultsTableView >> tableColumnWithIdentifier:@"startDateColumnIdentifier"] bind:@"title" >> toObject:resultsArrayController >> withKeyPath:@"arrangedObjects.topic.taskStartStringForPanel" options:nil]; >> >> If the cell for the column is an NSTextFieldCell, and the binding is >> "value", this displays the string successfully, but when I change to an >> NSButtonCell and try to bind "title", I get the error message. > > That's because you're binding the table column, not the data cell. Table > columns don't have a "title" binding. > > In the simple case, binding the table column's "value" binding to a value > works because the default behavior transfers the bound value to the data cell > each time it's used. (As you know, the data cell for the column is re-used > for each row that's displayed.) Clearly, that can't work for a button cell's > "title" binding. > > You're going to have to use one of the various data cell preparation methods > to set up the correct title every time the button cell is used. This set-up > *could* re-bind its "title" binding every time, but there's no point -- it's > simpler just to set the desired title string directly. > > There are two points worth noting here: > > 1. You can't use a set-once-and-forget approach to binding the button cell > title, because the button cell is re-used for every row. > > 2. For the normal "value" binding, it *seems* that you can use a > set-once-and-forget approach, but that works because the table column has > internal behavior to transfer this binding value to the data cell every time > it's used. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com