Re: Using NSUserDefaults from a bundle-less app
Re: Using NSUserDefaults from a bundle-less app
- Subject: Re: Using NSUserDefaults from a bundle-less app
- From: "John C. Randolph" <email@hidden>
- Date: Thu, 3 Apr 2003 18:13:40 -0800
On Thursday, April 3, 2003, at 05:29 PM, ROSE,ROBERT W
(HP-Corvallis,ex1) wrote:
Hi, I've got a bundle-less background application that uses Cocoa, and
I
would like to be able to use NSUserDefaults from it so that my
foreground
app can read information out of the defaults that are saved..
Unfortunately, I can't find a way to specify what domain the
background app
should use. Currently I'm trying this:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: foo forKey: bar];
...
// program exits shortly after
This does absolutely nothing, that I can tell. I think it's because my
background app doesn't have a bundle... so how do I specify what
domain to
save these defaults in?
You can open different defaults domains using -persistentDomainForName:
AFAIK, it doesn't care whether your program lives in a bundle, just
that it's linked to the foundation framework.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.