The only reliable* way to access system preferences is through the CFPreferences API which NSUserDefaults is built on.

CFURLCreateDataAndPropertiesFromResource() and CFPropertyListCreateXMLData() for read.

CFPropertyListCreateXMLData() and CFURLWriteDataAndPropertiesToResource() to write.

I'm afraid you're missing the point; think of the PLIST files simply as a convenient representation of the defaults database. There is no guarantee that preference domains outside your control will remain; named consistently, where you expect them, nor in any particular format. The format of the defaults database is maintained by the CFPreferences API and should only be accessed through it.

From the docs:

Preferences files are stored in the system’s or user’s preferences directories. On Mac OS X versions 10.0 to 10.4 these are in /Library/ Preferences and in /Library/Preferences in the user’s home directory respectively. When debugging an application, it may sometimes be useful to inspect these files to determine that preferences have been saved correctly, however you should never hardcode these paths into an application. If you do need to access the directory programmatically you should use the NSSearchPathForDirectoriesInDomains API, although there should typically be no reason to do so.

It's all very well that you can read and write to them directly; but it really isn't advisable. I'm certain the docs state NOT to assume the preference format either though I can't find it now, you simply need to take package receipts as an example though.

Keith Duncan
[EMAIL PROTECTED], 33software.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to