Re: bindings with NSView subclass
Re: bindings with NSView subclass
- Subject: Re: bindings with NSView subclass
- From: mmalcolm crawford <email@hidden>
- Date: Mon, 23 Feb 2004 00:08:02 -0800
On Feb 22, 2004, at 8:40 PM, Alan Donsky wrote:
Anybody know how to make bindings work in a custom NSView?
Here is what i have done:
Called exposeBinding: in the views initialize method for the instance
variable i want to bind.
You don't need to do that unless you create an IB palette item for the
view.
Written KVC compliant acceccors for the instance variable
Called bind:toObject:withKeyPath:options: in awakeFromNib to make the
binding to a controller,
It works pretty well in that changes to the model result in changes to
the view, but the problem is that if i make changes in the view, they
do NOT cause a change in the model. I am not sure how this is supposed
to work.
You need to conform to NSEditor:
http://cocoa.mamasam.com/COCOADEV/2004/01/2/82382.php
Still no good example for that one, I'm afraid...
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.