Re: CoreData, setValue, needsDisplay, and undo
Re: CoreData, setValue, needsDisplay, and undo
- Subject: Re: CoreData, setValue, needsDisplay, and undo
- From: Chris Hanson <email@hidden>
- Date: Fri, 16 Mar 2007 17:32:47 -0700
On Mar 16, 2007, at 3:19 PM, Timothy Larkin wrote:
In a common situation, a change in the value of an object attribute
requires an update of some rectangle in a view. Without CoreData, I
would create some code to invalidate the rectangle in the set<key>
method.
Is there some other solution that I'm not seeing? What is the best
practice?
I think the best practice is to decouple your model and your view a
little more, so your model isn't telling your view anything directly
but is instead letting a view and controller work out how to display
and interact with it.
A good, modern way to do this would be to implement bindings support
in your view, and set it up to bind to a standard kind of NSController
(Object, Array, or Tree, whichever's most appropriate) which is in
turn bound to your model.
Many developers also use notifications for this.
-- 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