Re: NSUserDefaults and using volatile domains
Re: NSUserDefaults and using volatile domains
- Subject: Re: NSUserDefaults and using volatile domains
- From: Jesse Wesson <email@hidden>
- Date: Thu, 4 May 2006 15:24:09 -0700
Thanks Chris for the help. Looks like I'll have to subclass
NSUserDefaults to get the behaviour I'd like.
Jesse
On May 4, 2006, at 1:14 pm, Chris Parker wrote:
Hi Jesse,
-searchList and -setSearchList: have been non-functional since Mac
OS X 10.0. Currently, the only modification of the search path we
allow is the addition of suite preferences to an application.
We have an enhancement request to allow the adding of volatile
domains to the suite preferences, but OS X has never allowed
arbitrary search path manipulation.
.chris
--
Chris Parker
Cocoa Frameworks
Apple Computer, Inc.
On May 4, 2006, at 1:10 PM, Jesse Wesson wrote:
I was hoping to insert the environment variables between
NSArgumentDomain and the application domain. Is this no longer
possible with the removal of -searchList and -setSearchList:?
Jesse
On May 1, 2006, at 9:43 am, Chris Parker wrote:
On Apr 29, 2006, at 10:11 AM, Jesse Wesson wrote:
I would like to add a volatile domain (the process’ environment
variables) to the search path of my command line tool’s user
defaults. Once I add the dictionary though, all the keys return
nil (code snippet below). Once a volatile domain is added, is it
not included to the search path?
Jesse
[[NSUserDefaults standardUserDefaults] setVolatileDomain:
[[NSProcessInfo processInfo] environment]
forName:@"EnvironmentVariableDomain"];
NSString *path = [[NSUserDefaults standardUserDefaults]
objectForKey:@"PATH"];
NSLog( @"PATH=%@", path );
-setVolatileDomain:forName: only associates a dictionary with the
name in the NSUserDefaults object - it does not add it to the
search path.
Is there a particular reason you'd like to do this? -
[NSProcessInfo environment] is the correct way to pick up the
environment variables. If you absolutely must have them in your
search path, you could use -[NSUserDefaults registerDefaults:]
with the dictionary returned from -[NSProcessInfo environment],
but that's the best you could do.
.chris
--
Chris Parker
Cocoa Frameworks
Apple Computer, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden