• 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: NSObject's bind:toObject:forKeyPath:options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSObject's bind:toObject:forKeyPath:options


  • Subject: Re: NSObject's bind:toObject:forKeyPath:options
  • From: David Spooner <email@hidden>
  • Date: Sun, 25 Nov 2007 09:16:43 -0700

I believe NSObject's implementation works roughly as follows...

- (void)bind:(NSString *)binding toObject:(id)model withKeyPath: (NSString *)path options:(NSDictionary *)options;

An auxiliary object is created which is registered as an observer of the given key path of the given model object; In response to observation, the auxiliary object invokes -setValue:forKey: on the original receiver; -unbind: removes the observation and releases the auxiliary object. If you don't call super then you'll also have to override -infoForBinding:

Cheers,
dave


On 24-Nov-07, at 7:38 PM, Mike R. Manzano wrote:

Well, for one, Apple's own "joystick" example overrides it:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html


on 11/24/07 1:26 AM, Keary Suska purportedly said:

> What does NSObject's implementation of
> bind:toObject:forKeyPath:options: do?
>
> Should my class' implementation of it call it on its superclass?


I would ask, why do you feel the need to override the method? Binding
structures have introspection, if you needed that. Otherwise, I would say,
yes, if you override it, you should call the method on super.


Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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


References: 
 >Re: NSObject's bind:toObject:forKeyPath:options (From: "Mike R. Manzano" <email@hidden>)

  • Prev by Date: Re: NSWindow - Sheets - background alpha value
  • Next by Date: Re: NSTableView and Empty Selection
  • Previous by thread: Re: NSObject's bind:toObject:forKeyPath:options
  • Next by thread: Re: NSObject's bind:toObject:forKeyPath:options
  • Index(es):
    • Date
    • Thread