Re: [Pyobjc-dev] Key Value Observing of lists?
Brought to you by:
ronaldoussoren
|
From: Orestis M. <or...@or...> - 2008-06-01 19:43:49
|
Hi, I've just stumbled on this again (I'll be writing a short blog post about it when my host is back online). I think I'm a bit confused... >> Hi, >> >> I'm trying to bound an NSTableView to a list using an array >> controller. This works fine, as long as I don't mutate the list >> (list.append, for example). > > I'm pretty sure this bit is documented somewhere. It is technically > impossible to make PyObjC do the right thing here without patching > the Python interpreter. Just to make things very clear, is this not possible even if using a Cocoa collection like NSMutableArray and calling Cocoa methods on it (insertObject_atIndex_)? So basically, _every_ method that mutates something that needs to be observable must be surround with "willChangeValueForKey_" and "didChangeValueForKey_", right? Is there any shortcut for doing this? Regards, Orestis |