Re: NSMenuItem Binding Problem
Re: NSMenuItem Binding Problem
- Subject: Re: NSMenuItem Binding Problem
- From: Dave Keck <email@hidden>
- Date: Wed, 11 Mar 2009 12:32:33 -1000
It sounds like you're accessing the variable directly, which doesn't
allow the KVO system to send the appropriate notifications in order to
notify the menu item that there was a change. If you want to set the
value of the variable and expect the menu item to respond, you must
make sure the appropriate KVO notifications are being sent. This can
be done in several ways - through generated accessors (properties) or
sending the willChangeValueForKey/didChangeValueForKey messages
manually.
Try reading up on KVC:
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/BasicPrinciples.html
and KVO: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/Overview.html
(KVO/KVC are the technologies that the bindings system relies on.)
... and could you post the relevant code?
David
_______________________________________________
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