• 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: NSArrayController Undo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController Undo


  • Subject: Re: NSArrayController Undo
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 14 May 2010 11:02:11 -0700

On May 14, 2010, at 10:44, Richard Somers wrote:

> I see what you are saying. The path I was following was a little different. Each model object has a 'selected' attribute or property. When the array controller selection is set, the model objects 'selected' property is also set. What I was trying to do was figure out how to get each model object's 'selected' property back into the array controller's selection.

Well, binding the array controller's selection indexes is the easy way. :)

> You are suggesting that I just use the array controller's selection, which is an index set, and just put that into Core Data. That would work for a transient property but not for an on disk persistent store. The index set of the array controller is based on an in-memory arrangement of model objects and could change and does change from one document opening to the next. But if I do not need persistence this might be the way to go.

You can easily write your own reversible transformer to convert between index sets and whatever you want the persistent representation to be. Two points to note:

1. This is somewhat more convenient now that you no longer have to register transformers manually on application startup. (The documentation used to be a bit unclear on this.)

2. Warning! Core Data runs custom transformers in the *opposite* direction from the standard one. (The documentation used to be a bit unclear on this.)


_______________________________________________

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

References: 
 >NSArrayController Undo (From: Richard Somers <email@hidden>)
 >Re: NSArrayController Undo (From: Quincey Morris <email@hidden>)
 >Re: NSArrayController Undo (From: Richard Somers <email@hidden>)
 >Re: NSArrayController Undo (From: Quincey Morris <email@hidden>)
 >Re: NSArrayController Undo (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: NSArrayController Undo
  • Next by Date: Re: TUTORIAL: Generating Unique ID Strings
  • Previous by thread: Re: NSArrayController Undo
  • Next by thread: Re: NSArrayController Undo
  • Index(es):
    • Date
    • Thread