RE: kCFPreferencesAnyUser w/PreferencePane not working?
RE: kCFPreferencesAnyUser w/PreferencePane not working?
- Subject: RE: kCFPreferencesAnyUser w/PreferencePane not working?
- From: "Huyler, Christopher M" <email@hidden>
- Date: Tue, 22 Jun 2004 17:03:51 -0400
- Thread-topic: kCFPreferencesAnyUser w/PreferencePane not working?
>
> I have a PreferencePane which controls system wide preferences. I
>
> tried
>
> the following to store the preferences but it just creates a
>
> preferences
>
> file in the current user's ~/Library/Preferences folder instead of a
>
> file in /Library/Preferences. Am I missing something?
>
>
>
> tmpString = [worker getAlert];
>
> if (tmpString)
>
> {
>
> [alertField setStringValue:(NSString *)tmpString];
>
> CFPreferencesSetAppValue( CFSTR("alertField"), tmpString, prefID,
>
> kCFPreferencesAnyUser, kCFPreferencesAnyHost);
>
> }
>
> CFPreferencesSychronize( prefID, kCFPreferencesAnyUser,
>
> kCFPreferencesAnyHost );
>
>
The current user may not have the appropriate permissions to write to
>
global preferences. I would have expected the error in that case to be
>
a failure to write, but I could be mistaken about that. Also, are you
>
sure you want kCFPreferencesAnyHost rather than
>
kCFPreferencesCurrentHost?
All the examples on Apple's site use kCFPreferencesAnyHost as the
default. The user I tested it with has admin permissions. How would I
know whether the user has permissions? How could I allow a user w/o
permissions to save the preferences? I am already requiring the user to
authenticate to run some shell scripts that make changes to the backend,
I could incorporate updating the preferences into that, but I'm not sure
how.
_______________________________________________
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.