Skip navigation.
 
mlRe: Table views with different NSArrayControllers sharing the same data object...
FROM : Quincey Morris
DATE : Thu Feb 28 22:08:00 2008

On Feb 28, 2008, at 12:19, Keith Blount wrote:

> I have a feeling I'm approaching this all wrong, given that now I'm 
> trying to bind my DataList object's -backgroundColor to the view's 
> backgroundColor so that changes to the background colour in one view 
> will automatically update in the other, but this doesn't work at all 
> (the model object's accessors never get called).


Well, if fate was kind, then binding the DataListView's 
backgroundColor to dataList.backgroundColor (instead of the other way 
around) should solve the problem. (The color well should also be bound 
to dataList.backgroundColor.)

But apparently fate is not kind, since I don't see that NSTableView 
exposes 'backgroundColor' as a binding. It looks fairly easy to do 
(exposeBinding in your subclass and bindToObject: somewhere, possibly 
in your subclass) though I've never tried it. Or use 
[dataList.backgroundColor addObserver: self ...] in the DataListView 
and bypass bindings for this one property.

Related mailsAuthorDate
mlRe: Table views with different NSArrayControllers sharing the same data object... Keith Blount Feb 28, 21:19
mlRe: Table views with different NSArrayControllers sharing the same data object... Quincey Morris Feb 28, 22:08