Re: NSUserDefauts - Am I Missing the Obvious?
Re: NSUserDefauts - Am I Missing the Obvious?
- Subject: Re: NSUserDefauts - Am I Missing the Obvious?
- From: Vince DeMarco <email@hidden>
- Date: Wed, 18 Dec 2002 22:30:25 -0800
Is this an in an Application or a foundation tool??
In an Application
- (BOOL)synchronize;
on quit or when the application run loop fires
after setting the default add this line
[defaults synchronize];
it should work then.
vince
On Wednesday, December 18, 2002, at 09:48 PM, Eric Kolotyluk wrote:
I do something like the following in my application
[defaults setObject:@"some string" forKey:@"myKey"];
later after restarting the program, I do something like
NSString *myString;
myString = [defaults objectForKey:@"myKey"];
if (myString != nil)
{
// do something
}
else
NSLog(@"myKey is missing");
which logs "myKey is missing" every time. After reading the
documentation on User Defaults several times over I no grok. Is there
something I have to do in my application bundle before I can set
objects in the Application domain, or am I missing something more
basic? Where is the User Defaults dictionary stored? Is there some way
to inspect it?
I'm an old NeXT developer from way back, but I'm having to learn a few
new tricks with Cocoa.
Cheers, Eric
_______________________________________________
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.
_______________________________________________
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.