Re: Ghost value in NSUserDefaults
Re: Ghost value in NSUserDefaults
- Subject: Re: Ghost value in NSUserDefaults
- From: Clark Cox <email@hidden>
- Date: Sun, 9 Jan 2005 11:03:43 -0500
On Sun, 9 Jan 2005 14:47:29 +0100, Stephan Burlot
<email@hidden> wrote:
> Hi,
>
> I have a value in my NSUserDefaults which seems to come from nowhere:
>
> I have in my project's info.plist:
> <key>CFBundleIdentifier</key>
> <string>com.colorplaza.colormailer</string>
>
> I do a rm ~/Library/Preferences/com.colorplaza.colormailer.plist
> (just to be sure, doint a defaults read com.colorplaza.colormailer
> gives:
> 2005-01-09 14:28:31.932 defaults[22987]
> Domain com.colorplaza.colormailer does not exist
> )
>
> I start my application and do:
> #define COUNTRY_KEY @"Country"
>
> NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
> NSDictionary *defaultValues = [NSDictionary
> dictionaryWithObjectsAndKeys:
> @"", SERVICE_KEY,
> @"", COUNTRY_KEY,
> @"", LANGUAGE_KEY,
> @"", USERNAME_KEY,
> @"", PASSWORD_KEY,
> nil, ALERT_KEY,
> @"No", MODE_KEY,
> @"", DEFAULT_PAPERID_KEY,
> @"", SERVICE_ID_FOR_PAPER_KEY,
> nil];
Though I can't answer your question conclusively, one issue that I
noticed: dictionaries cannot contain nil. When
+dictionaryWithObjectsAndKeys: sees the nil (before ALERT_KEY) it
stops there, so the resulting dictionary does *not* contain any keys
or objects for ALERT_KEY, MODE_KEY, DEFAULT_PAPERID_KEY or
SERVICE_ID_FOR_PAPER_KEY
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
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