• 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: How to know whether property in Cocoa class is KVO-compliant?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to know whether property in Cocoa class is KVO-compliant?


  • Subject: Re: How to know whether property in Cocoa class is KVO-compliant?
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 11 Jan 2010 03:47:05 -0800

On Jan 10, 2010, at 19:58, Jerry Krinock wrote:

> After studying some about bindings during the last week, I decided that, just for fun, I would bind an NSSegmentedControl to its window controller using a binding instead of target/action.  I thought that selectedSegment might be a KVO-compliant property of NSSegmentedControl because it has a -selectedSegment and -setSelectedSegment: method.
>
> So I exposed a binding named @"foo" in my window controller's +initialize, in -awakeFromNib I added this:
>
>  [windowController bind:@"foo"
>                toObject:segmentedControl
>             withKeyPath:@"selectedSegment"
> 	         options:0] ;

Adding on to mmalc's response, to make this explicit:

You *didn't* "bind an NSSegmentedControl to its window controller", you actually bound a window controller['s "foo" binding] to [the "selectedSegment" property of] a NSSegmentedControl.

IIRC the bindings documentation isn't clear which direction "is bound to" refers to and/or it gives the impression that a binding is symmetric (which it may effectively be at the level of notifications, but it isn't at the level of establishing bindings between objects).


_______________________________________________

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"; Was: whether property in Cocoa class is KVO-compliant?
      • From: Jerry Krinock <email@hidden>
References: 
 >How to know whether property in Cocoa class is KVO-compliant? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: pointer being freed was not allocated when rotating an iPhone
  • Next by Date: Re: pointer being freed was not allocated when rotating an iPhone
  • Previous by thread: Re: How to know whether property in Cocoa class is KVO-compliant?
  • Next by thread: Re: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?
  • Index(es):
    • Date
    • Thread