Re: Cocoa bindings with an Array...
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