Re: Replacing NSUserDefaults
Re: Replacing NSUserDefaults
- Subject: Re: Replacing NSUserDefaults
- From: David Remahl <email@hidden>
- Date: Tue, 24 Jul 2001 12:16:07 +0200
Is it possible to set a NSDictionary back into NSUserDefaults and have
it replace ALL keys and values currently in NSUserDefaults?
My goal is to save the Defaults to a dictionary, change some things in
the Defaults, then restore the defaults to their old values.
While it's not a good solution, maybe this could work:
[myDictionary writeToFile:[[[NSHomeDirectory()
stringByAppendingString:@"/Library/Preferences/"]
stringByAppendingString:[[[NSBundle mainBundle] infoDictionary]
valueForKeyPath:@"CFBundleIdentifier"]] atomically:YES];
Why not:
[[NSUserDefaults standardUserDefaults] setPersistentDomain:(NSDictionary
*)domain forName:(NSString *)domainName];
?
/ david