• 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: CoreData, setValue, needsDisplay, and undo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CoreData, setValue, needsDisplay, and undo
      • From: Rob Keniger <email@hidden>
References: 
 >CoreData, setValue, needsDisplay, and undo (From: Timothy Larkin <email@hidden>)

  • Prev by Date: Re: (no subject) - NSOutlineView
  • Next by Date: Re: Setting the Key window after sheet ends
  • Previous by thread: CoreData, setValue, needsDisplay, and undo
  • Next by thread: Re: CoreData, setValue, needsDisplay, and undo
  • Index(es):
    • Date
    • Thread