bindings confusion
bindings confusion
- Subject: bindings confusion
- From: Torsten Curdt <email@hidden>
- Date: Tue, 20 Sep 2011 11:13:31 +0200
Before I was following the docs and wrote the bindings clue code myself
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html#//apple_ref/doc/uid/20002373
- (void)bind:(NSString *)binding toObject:(id)theObservedObject
withKeyPath:(NSString *)theKeyPath options:(NSDictionary *)options
{
...
self.observedObject = theObservedObject;
self.observedKeyPath = theKeyPath;
[theObservedObject addObserver:self
forKeyPath:theKeyPath
options:NSKeyValueObservingOptionInitial
context:nil];
...
}
Now I have found these posts suggesting that it is not required to (or
even one should not) override bind:toObject:withKeyPath:options:
http://www.tomdalling.com/blog/cocoa/implementing-your-own-cocoa-bindings
http://stackoverflow.com/questions/1169097/can-you-manually-implement-cocoa-bindings
http://stackoverflow.com/questions/366938/is-it-necessary-to-override-bindtoobjectwithkeypathoptions-in-an-nsview-subcl/
But I see myself in the same camp:
When I don't override bind:toObject:withKeyPath:options: my custom
NSView's bindings do not work.
Could someone clear this up?
cheers,
Torsten
_______________________________________________
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