• 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: Richard Somers <email@hidden>
  • Date: Fri, 14 May 2010 11:44:02 -0600

On May 14, 2010, at 10:25 AM, Quincey Morris wrote:

If I understand you correctly, you're on the right track -- you want to bind the array controller's selection indexes to your data model's selection property. However, Core Data properties don't support index sets as a standard data type, so you have more work to do. Since NSIndexSet supports NSCoding, your easiest choice is probably to make your selection a transformable attribute. That means Core Data automatically converts the value to and from an archive using a standard transformer.

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.


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.

--Richard

_______________________________________________

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


  • Follow-Ups:
    • Re: NSArrayController Undo
      • From: Quincey Morris <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>)

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