Now I see different documentations on how to implement bindings in
custom views (includng your GraphicsBindings) and I'm a bit confused/
disappointed :
Do you want to use a custom view, or NSTextView?
In almost every examples I saw, it seems that I have to implement
KVO myself in
- (void)bind:(NSString *)bindingName
toObject:(id)observableObject
withKeyPath:(NSString *)observableKeyPath
options:(NSDictionary *)options
It's not clear what you mean.
In your bind method, you must add yourself as an observer of an object
to which you are bound. That doesn't seem unreasonable or an
imposition of a significant overhear -- it's one method call.
but I thought NSObject was KVO compliant so that when I
willChangeValue / didChangeValue, it was responsabile of annoucing
the chages to every observers, automatically setup in
bind;toObject:withKeyPath:options: implementation of NSObject.
If you're not sure which way round bindings work, I would strongly
suggest re-reading the documents I cited earlier and trying some of
the more basic tutorials before spending more time on implementing a
custom view. I would then suggest looking at the Joystick example (<http://developer.apple.com/samplecode/BindingsJoystick/
>) which is a full implementation of the example used in the
documentation. It shows what observation you need to set up in the
bind:... method, and how to implement the observe... method.
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com