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 for the list of colours, and add that as a single item to the user 
defaults? It would be much simpler and efficient, and probably less prone to 
difficult to understand code paths as you'd have one less level of indirection 
(or possibly two less - you wouldn't need the array either).

I expect the problem is because the changes you're making are an extra level of 
indirection inside the data structure and are not being observed by the user 
defaults binding. I could be wrong though as bindings is not something I'm very 
intimate with.

Also, check out whether NSColorList will do what you need here - it already 
maintains lists of named colours.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to