• 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: Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings


  • Subject: Re: Bindings
  • From: Chris Hanson <email@hidden>
  • Date: Sat, 26 May 2007 19:07:15 -0700

On May 26, 2007, at 6:20 PM, Sandro Noel wrote:

ok here is my case.

I have a NSMutableArray of NSNetService

Stop right here. Do you know whether NSNetService supports Key-Value Observing? This is a requirement for anything you wish to bind to.


As someone put it not too long ago on the list (diagram reproduced from memory):

Change in model object uses KVO to propagate through controller objects to view objects:

    Model o----[KVO]--->> Controller o----[KVO]--->> View

Manipulation of view uses KVC to push changes through controller object to model object:

    Model <----[KVC]----o Controller <----[KVC]----o View

When a model object changes, it posts KVO notifications. If a view is bound to a model object (via a controller, of course) it will get them via the controller. When a user manipulates a view object, the view object uses key-value coding to push those changes through its controllers to the appropriate model object.

This means that anything used in bindings will have to be KVC and KVO compliant.

Another important question: Do you consider NSNetService instances to be model objects in your application? For the vast majority of applications -- even in the case of something like Xcode's Distributed Build preferences -- the answer is likely to be "No."

I think you would probably be better off creating your own model class that supports Key-Value Observing, and which represent the actual model of your application. Then instances of this class can either *use* NSNetService instances or be *managed by* something that uses NSNetService instances to locate services via Bonjour.

  -- Chris

_______________________________________________

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

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Bindings
      • From: Sandro Noel <email@hidden>
References: 
 >Bindings (From: Sandro Noel <email@hidden>)

  • Prev by Date: Bindings
  • Next by Date: Re: Bindings
  • Previous by thread: Bindings
  • Next by thread: Re: Bindings
  • Index(es):
    • Date
    • Thread