Re: Bindings: is there a better way to observe when an object changes?
Re: Bindings: is there a better way to observe when an object changes?
- Subject: Re: Bindings: is there a better way to observe when an object changes?
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 10 Sep 2007 10:50:09 -0700
On 9/10/07, Simone Tellini <email@hidden> wrote:
> Hi,
>
> I've created an NSView subclass which needs to be redrawn every time
> an entity object changes, where "changes" means that any of its
> attributes change.
>
> Does anybody know a better way or should I stick with this
> implementation?
Does your view use "any of" the objects attributes? Likely the view is
only using a subset of items when drawing its representation ("view")
of the data. So in theory the view knows what is is using and it
should observe those and only those. ...granted theory and practice
are often different things.
If you have a complex interaction between properties of the data you
can bring sanity again by providing composite properties that hide the
interactions of these bits of data. In your case you are providing a
top level one that covers all properties ... however consider
providing ones better tuned to how your view would look at the data
(consider adding a category with these to note these are tuned toward
you view class(es), etc.).
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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