• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSEditor, NSEditorRegistration Protocols
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEditor, NSEditorRegistration Protocols


  • Subject: Re: NSEditor, NSEditorRegistration Protocols
  • From: Dustin Voss <email@hidden>
  • Date: Tue, 2 Mar 2004 22:46:02 -0800

On 2 Mar, 2004, at 5:49 PM, 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.

It seems like a sloppy implementation, and the online documentation sucks. How is the view even supposed to send the message to the controller without having an outlet to that controller?

These protocols work in conjunction with the rest of Cocoa Binding and key-value observing. I believe that, in order to use bindings, your view needs to implement the NSKeyValueBindingCreation protocol.

Your view's bind:toObject:withKeyPath:options: method will be called to set up the binding. You'll get an object and a key path. They are the model, as far as your view is concerned. They could be a genuine model object, or something exposed by a controller.

Your view will need to observe the key path to know if the model changes. When your view wants to make a change, it should call setValue:forKey: on the model object.
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSEditor, NSEditorRegistration Protocols
      • From: Dustin Voss <email@hidden>
References: 
 >NSEditor, NSEditorRegistration Protocols (From: Alan Donsky <email@hidden>)

  • Prev by Date: Re: NSEditor, NSEditorRegistration Protocols
  • Next by Date: Re: Manual binding & NSOutline
  • Previous by thread: Re: NSEditor, NSEditorRegistration Protocols
  • Next by thread: Re: NSEditor, NSEditorRegistration Protocols
  • Index(es):
    • Date
    • Thread