On May 19, 2009, at 1:44 PM, Quincey Morris wrote:

On May 19, 2009, at 14:18, Stuart Malin wrote:

<snip>
My specific concern is with NSSegmentedControl, which has a bindable
property "selectedIndex". I am trying to add an observer for this
property (using -addObserver: on an instance). Alas, I am not
getting an observer event (i.e, invocation of my -
observerForKeyPath:... method) when I change the segmented control
in the U/I.  So, either I have done something incorrectly in setting
up the observer, or this is not an observable property.

<snip>
Finally, it usually indicates a design flaw if you're trying to
observe a property of a user interface object. It's almost always
better to observe the value that the UI object is bound to. (There are
valid exceptions, though.)

I don't see why it is a design flaw to want to bind to the selectedIndex of a segmented control so that when the user changes the selected segment, my code to take action. Binding to the control is conceptually quite similar. The two approaches to me seem to be matters of implementation specifics.
_______________________________________________

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 arch...@mail-archive.com

Reply via email to