• 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: Cocoa bindings with an Array...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa bindings with an Array...


  • Subject: Re: Cocoa bindings with an Array...
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 16 Feb 2005 19:07:43 -0800


On Feb 16, 2005, at 6:52 PM, Jiva DeVoe wrote:

Must I observe every item in the array?

Yes. If you observe an array, you're just observing the array, not the individual elements within it.


See the GraphicsView class in GraphicsBindings at <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html> for an example.

Couldn't that become expensive?

Yes and no. Yes, it may be comparatively "expensive" to add an object as an observer of many other objects, but:
* Observer notifications are only sent when a change is made.
* If you need to keep model and view synchronised, you need to do some work (such as sending messages) anyway.
* The KVO mechanism is very efficient, and is likely to incur less overhead than custom glue code.


mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Cocoa bindings with an Array... (From: Jiva DeVoe <email@hidden>)

  • Prev by Date: Cocoa bindings with an Array...
  • Next by Date: Customizing Mail.app
  • Previous by thread: Cocoa bindings with an Array...
  • Next by thread: Customizing Mail.app
  • Index(es):
    • Date
    • Thread