On Fri, Jun 20, 2008 at 1:00 PM, Milen Dzhumerov <[EMAIL PROTECTED]> wrote:
> I'm building a 3-pane interface and I have a NSTreeController managing the > sidebar. My actual content displayed in the main view is bound to the > "selection" of the tree controller. When I insert a new object into the tree > controller (I've disabled selection of inserted objects), I can see the new > object added and the controller also preserves the selection visually. But > it actually sends a KVO that selection changed - but it has not (even > logging the selection object returns the same _NSControllerObjectProxy > instance). I think that NSTreeController (and NSArrayController and NSObjectController) send a notification for pretty much everything that can change any time anything changes... and rely their observers to actually work out if anything really did change. And even more annoyingly, the proper change dictionaries are not included with these notifications. > The problem is that when selection changes, my main view > interpolates / animates it's new state - so it fades-in and fades-out > without changing its appearance. Is there a way to tell the controller not > to send KVO notifications when the selection has not actually changed? > Otherwise I would have to keep a flag in the main view whether any changes > are real or just redundant. I'm afraid that's about the size of it. Note that in Leopard, you can register for NSKeyValueObservingOptionPrior which makes this easier (you'd want to observe selectionIndexPath or something because, as you noted, the "selection" object is just a proxy that never changes). Hamish _______________________________________________ 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 [EMAIL PROTECTED]