CFPreferences : How to save system-wide setting for your preference pane

    According to the Apple’s document, it is possible to use the CFPreferences and SFAuthorizationView to authenticate and authorize as an admin or the root. However, I found something strange. Although it was successful to be authorized as an admin using the SFAuthorizationView and CFPreferences functions, it didn’t create preference files in /Library/Preferences. What I mean is.. even though CFPreferencesCopyValue() and CFPreferencesSetValue() are called successfully, it doesn’t create a preference file in the /Library/Preferences.

    Why? I don’t know. Actually I didn’t have enough time to fix it. 

    But, anyway, for being able to retrieve system-wide setting when you open your preference pane, accessing by requesting admin ID and password is not good. Only when you want to set value, it should ask such information.

    Apple provides a good sample code for such cases. You can just grab the CFPreferences_SharedAppValue.c and h and use them.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: