Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
- Subject: Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
- From: Quincey Morris <email@hidden>
- Date: Fri, 2 Apr 2010 22:25:46 -0700
On Apr 2, 2010, at 22:17, Jerry Krinock wrote:
> So you're telling me that all of the keys in a key path must be KVO-compliant. I hadn't thought so, because in the key path "fooArrayController.selection", the fooArrayController is hard-wired to an IBOutlet and never changes. But now I see a possible explanation is that the Cocoa Bindings Wizard created its observer before the fooArrayController got wired to its outlet.
No, KVO compliance isn't required for a bound-to key that never changes.
The issue I had in mind is that that the "fooArrayController" key *does* change -- when the nib is loaded to changes from nil to its correct value. Thus, anything that tries to observe it before nib loading is going to be observing a nil object and will never know any different. Things that observe it after the outlet is set during nib loading will be fine.
However, I think this is a false trail. Kyle had the correct answer.
_______________________________________________
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