Re: NSUserDefaults question
Re: NSUserDefaults question
- Subject: Re: NSUserDefaults question
- From: Chris Parker <email@hidden>
- Date: Tue, 5 Mar 2002 10:00:55 -0800
Hi Angela,
On Tuesday, March 5, 2002, at 02:31 AM, Angela Brett wrote:
[code to write to a specific domain snipped]
which is quite a bit more complicated than just using [[NSUserDefaults
standardUserDefaults] setObject:myObject forKey:myKey] which I would do
to save a default to the specific defaults for that app.
I know that I could do it in one line with
CFPreferencesSetAppValue((CFStringRef)myKey,myObject,CFSTR("My Main
Defaults thingy"));
So, if there is a simple one-line way of changing a single default for
the app name of my choice in CoreFoundation, how come there isn't a
method like that in NSUserDefaults? Or is there one, and I just haven't
see it?
Well it's mainly that NSUserDefaults doesn't expose all the features of
CFPreferences (like being able to write to a specific domain without
jumping through those hoops). Likewise CFPreferences doesn't do all the
things NSUserDefaults does (volatile domains, argument domain, etc).
In the meantime you can certainly use the CF routine to do this.
.chris
--
Chris Parker <email@hidden>
Cocoa Frameworks Engineer
_______________________________________________
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.