Re: NSEditor, NSEditorRegistration Protocols
Re: NSEditor, NSEditorRegistration Protocols
- Subject: Re: NSEditor, NSEditorRegistration Protocols
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 6 Mar 2004 12:28:55 -0800
On Mar 3, 2004, at 1:54 AM, Allan Odgaard wrote:
On 3. Mar 2004, at 2:49, Alan Donsky wrote:
Anybody know about these informal protocols? I am trying to
implement an NSView subclass that uses bindings and i think these
protocols are involved in telling the controller that the view has
changed so it can update the model.
I think it has already been stated, but these are not required. Simply
expose your key and make all changes to that key either through
set<Key>: or setValue:forKey:, these methods will send a
will/didChangeValueForKey:, which the controller should observe -- and
this is how it knows about changes made to your view.
This is wrong.
The controller observes the model, not the view. The view in turn
observes the controller. Value changes are propagated from view, via
controller, to model using KVC.
Editor registration is optional; it allows a view to notify a
controller that changes are being made, so that unfinished changes can
be committed for example before a window is closed.
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.