Le 30 mai 2012 à 16:56, Michael Nickerson a écrit :

> 
> On May 28, 2012, at 5:51 AM, Graham Cox <graham....@bigpond.com> wrote:
> 
>> 
>> That sounds fine, except that CFPreferencesCopyAppValue doesn't take a path, 
>> just a bundle ID and key. I can't see an alternative API that takes a path - 
>> are you saying I have to open the file and parse it myself? While that isn't 
>> too hard, it seems to be going against the point of having an API for 
>> preferences which isolate you from format changes and file system details 
>> and so on.
>> 
>> --Graham
>> 
>> 
>> 
> 
> The CFPreferences... calls will actually take a path. Just give it the path 
> where the bundle ID should go. This is not documented anywhere, but it works.
> 
> If you'd rather not count on that always working, you don't have to parse the 
> plist yourself, just read the plist in as data and use 
> NSPropertyListSerialization (or CFPropertyList, if you need the CF calls for 
> some reason) to parse it.

> ------------------
> 
> Michael Nickerson
> http://www.nightproductions.net

It does not solve the main issue. You assume the preferences are stored in 
property list, which is something not documented. 
Nothing prevent Apple to change it again to an other format that is not a 
property list, as the only documented way to access it is using 
CFPreferences/NSUserDefault API.

-- Jean-Daniel





_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to