• 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, custom objects, user defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController, custom objects, user defaults


  • Subject: Re: NSArrayController, custom objects, user defaults
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 5 Feb 2004 14:08:54 -0800

On Feb 5, 2004, at 12:50 PM, Yann Bizeul wrote:
You can't store custom objects in user defaults without encoding
them.. You'd need to use the value transformer that
archives/unarchives them to NSData.
As I said, I tried to make it NSCoder complient without success. In
fact I thought value transformer were for another level in the
hierarchy : Not for the whome object itself, but for their instance
variable (that will be used as "key" in bindings. I don't know if I'm
clear :

_______ 1 _______ ______ 2 ______ _ 3 __
NSArrayController -> myCustomObject1 -> aValue
-> myCustomObject2 -> aValue

According to me, NSValueDecoder is to decode level 3 variables, not
whole objects in level 2.

I'm not sure why NSValueDecoder comes into play?

NSValueTransformers apply to whatever value the widget is bound to.


So am I wrong, or is there a solution to
archive/unarchive level 2 objects in the NSArrayController

It's not clear what you're trying to achieve with the array controller. It's up to you to provide your variables in an appropriate form; if you extract immutable values from NSUserDefaults that are intended to be mutable, then you should create mutable copies of them before passing them to the controller (or use a value transformer as mentioned above).

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSArrayController, custom objects, user defaults (From: Yann Bizeul <email@hidden>)
 >Re: NSArrayController, custom objects, user defaults (From: Scott Anguish <email@hidden>)
 >Re: NSArrayController, custom objects, user defaults (From: Yann Bizeul <email@hidden>)

  • Prev by Date: Re: addTabViewItem exception was:(no subject)
  • Next by Date: Re: List-etiquette (was: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY)
  • Previous by thread: Re: NSArrayController, custom objects, user defaults
  • Next by thread: ANN: Pittsburgh area Cocoa Users Group Meeting
  • Index(es):
    • Date
    • Thread