Re: CFPreferences calls in Cocoa apps
Re: CFPreferences calls in Cocoa apps
- Subject: Re: CFPreferences calls in Cocoa apps
- From: Chris Parker <email@hidden>
- Date: Thu, 18 Nov 2004 09:27:55 -0800
Hi Tom,
On Nov 18, 2004, at 9:18 AM, Thomas Davie wrote:
I'm writing what is at heart a cocoa application, but needs to make
a few Core Foundation Preferences calls, specifically it needs to grab
the preferences for another application. I have been trying to use
CFPreferencesCopyKeyList to grab the preferences, but it apparently
always returns nil (at least within a cocoa app). Considering what
might be causing this, I decided to try synchronizing the preferences
first using CFPreferencesAppSynchronize, this unfortunately causes a
SIGABRT... Does anyone have any idea why this happens?
Without seeing a backtrace, no. :)
You should be fine calling CFPreferences API from within a Cocoa
application, and changes made in this way will be picked up by
NSUserDefaults.
If you're looking for a specific key within the other application's
preferences you should just be able to call
somePlistRef = CFPreferencesCopyAppValue(theKey, theAppBundleID);
and be able to retrieve that key.
I believe CFPreferencesCopyKeyList should work, but if it doesn't
please file a bug.
.chris
--
Chris Parker
Cocoa Frameworks
Apple, Inc.
_______________________________________________
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