FROM : David Spooner
DATE : Sun Nov 25 17:16:43 2007
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"
DATE : Sun Nov 25 17:16:43 2007
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"
| Related mails | Author | Date |
|---|---|---|
| Mike R. Manzano | Nov 24, 09:26 | |
| Keary Suska | Nov 24, 17:38 | |
| Mike R. Manzano | Nov 25, 03:38 | |
| David Spooner | Nov 25, 17:16 | |
| Keary Suska | Nov 26, 03:11 | |
| Mark Piccirelli | Dec 1, 05:50 |






Cocoa mail archive

