Re: Set Hierarchical NSUserDefaults Value
Re: Set Hierarchical NSUserDefaults Value
- Subject: Re: Set Hierarchical NSUserDefaults Value
- From: Klaus Backert <email@hidden>
- Date: Fri, 16 Jul 2010 20:00:27 +0200
On 16 Jul 2010, at 19:16, Jerry Krinock wrote:
On 2010 Jul 16, at 06:49, Richard Somers wrote:
On Jul 16, 2010, at 7:12 AM, Richard Somers wrote:
How do I change the "Second Level" value?
I think I just found out the answer to my question.
You can't. You must get and set the value as a dictionary.
or use something like this category I wrote last year, when I got
tired of uprooting and replanting entire trees in my User Defaults,
every time I wanted to change a leaf:
Attachment:
NSUserDefaults+KeyPaths.zip
Description: Zip archive
Since Mac OS X v10.3 there is a method
- (void)setValue:(id)value forKeyPath:(NSString *)keyPath
and above that a method
- (void)setValuesForKeysWithDictionary:(NSDictionary *)keyedValues
in the NSKeyValueCoding protocol.
Does this help?
Klaus
_______________________________________________
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