• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bindings and KVO of View objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings and KVO of View objects


  • Subject: Re: Bindings and KVO of View objects
  • From: Stuart Malin <email@hidden>
  • Date: Tue, 19 May 2009 14:22:40 -1000


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 (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


  • Follow-Ups:
    • Re: Bindings and KVO of View objects
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Bindings and KVO of View objects
  • Next by Date: Re: Tools in App Bundles
  • Previous by thread: Re: Bindings and KVO of View objects
  • Next by thread: Re: Bindings and KVO of View objects
  • Index(es):
    • Date
    • Thread