Re: What writes out a pref file?
Re: What writes out a pref file?
- Subject: Re: What writes out a pref file?
- From: Dan Yocom <email@hidden>
- Date: Thu, 14 Apr 2005 18:10:36 -0400
I think you need to add the following line:
// save preferences to the user's home directory/Library/Preferences.
[prefs writeToFile:[@"~/Library/Preferences/com.appName.plist"
stringByExpandingTildeInPath] atomically: TRUE];
hope it helps,
Dan
On 4/14/05, Mark Dawson <email@hidden> wrote:
> I added the following code to my +initialize method for my
> appController:
>
> NSMutableDictionary *dict;
> NSUserDefaults *defaults;
>
> defaults=[NSUserDefaults standardUserDefaults];
>
> dict=[NSMutableDictionary dictionary];
>
> [dict setObject:[defaults objectForKey:@"AppleMeasurementUnits"]
> forKey:@"MyMeasurements"]; // starts out the same as
> AppleMeasurementUnits
>
> [defaults registerDefaults:dict];
>
> However, I don't see the above key in my "com.appName.plist" file in my
> ~/Library/Preferences/ folder (the last mod date is yesterday). What
> do I need to do to write out new values? From what I could tell,
> launching and quitting should write it out, right? Or do I need to
> call something like synchronize?
>
> _______________________________________________
> 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
>
>
_______________________________________________
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