Re: Proper KVO with NSTreeController + NSOutlineView
Re: Proper KVO with NSTreeController + NSOutlineView
- Subject: Re: Proper KVO with NSTreeController + NSOutlineView
- From: Alex Zavatone <email@hidden>
- Date: Fri, 28 Sep 2012 08:33:57 -0400
On Sep 27, 2012, at 10:42 PM, Joseph M. Wollard wrote:
> I'm pretty sure I'm doing something wrong here. I have an NSTreeController bound to the 'value' of an NSOutlineView's table column. The NSTreeController's content is then bound to a property of one of my classes which feeds it an appropriate hierarchy of NSMutableDictionary objects. So, dict -> tree -> outline. All data is being displayed beautifully in the outline view.
>
> I'd like to observe a notification when a user edits (renames) an item in the outline view that tells me the old and new values. I'm getting notifications, but the old and new values are always null. For what it's worth, I'm currently observing the "content.name" key path of the NSTreeController instance - not sure if that makes a difference.
>
Seems like there's something that's not being passed, observed or called properly. Unlike when calling a unimplemented method in an object which crashes Objective C, I've found out that notifications of the wrong method name don't crash, but simply act as if nothing has happened. What has happened was that a notification was issued, but the method might have been misspelled and the program merrily continues without crashing but without telling you that there was no method to intercept and process that notification. That happened to me a few weeks ago. That doesn't sound like your problem, but thought that might help.
But, if the observed and new values are null, I'd guess that your reference to content.name isn't the correct reference to the object. Try tracing through the debugger to see where it thinks it's getting the value from.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden