FROM : Chris Parker
DATE : Thu Nov 18 18:27:55 2004
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.
DATE : Thu Nov 18 18:27:55 2004
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.
| Related mails | Author | Date |
|---|---|---|
| Thomas Davie | Nov 18, 18:18 | |
| Chris Parker | Nov 18, 18:27 | |
| The Karl Adam | Nov 19, 02:44 |






Cocoa mail archive

