Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
On Nov 13, 2009, at 6:58 AM, Graham Cox wrote: > > On 13/11/2009, at 4:41 PM, Martin Hewitson wrote: > >> The point is to store an array of 'items' with a 'name' together with a >> 'color'. And later there may be more properties of an 'item'. > > > This really calls for your own 'item' clas

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Graham Cox
On 13/11/2009, at 4:41 PM, Martin Hewitson wrote: > The point is to store an array of 'items' with a 'name' together with a > 'color'. And later there may be more properties of an 'item'. This really calls for your own 'item' class that holds all the various properties that you have in mind.

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
On Nov 13, 2009, at 1:39 AM, Graham Cox wrote: > > On 13/11/2009, at 8:18 AM, Martin Hewitson wrote: > >> Has anyone tried something like this, or can anyone see what I'm doing wrong? > > > I'm a bit mystified by your data structure here. Why do you use a separate > dictionary for each key/v

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Matt Mashyna
Are you calling setObject and sync with NSUserdefaults at some point? Matt Sent from my iPhone On Nov 12, 2009, at 4:18 PM, Martin Hewitson wrote: Dear list, The hardest part of this problem may be explaining it, but here goes. I want to store an array of dictionaries in NSUserDefaul

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Graham Cox
On 13/11/2009, at 8:18 AM, Martin Hewitson wrote: > Has anyone tried something like this, or can anyone see what I'm doing wrong? I'm a bit mystified by your data structure here. Why do you use a separate dictionary for each key/value pair (name/colour pair)? Why not just use one dictionary f

Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
Dear list, The hardest part of this problem may be explaining it, but here goes. I want to store an array of dictionaries in NSUserDefaults. In each dictionary I have a string and a color. The color is stored as data using NSArchiver. So I build an array of these dictionaries, then put that arr