• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFPreferences always returning null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFPreferences always returning null


  • Subject: CFPreferences always returning null
  • From: Jim Turner <email@hidden>
  • Date: Tue, 24 Feb 2004 10:18:26 -0600

I am trying to read the available keys from a very simple plist using
CFPreferencesCopyKeyList and it continually mocks me by returning null...
The important part of my code:

const CFStringRef appName = CFSTR( "com.apple.myPref" );
CFArrayRef keys;

keys = CFPreferencesCopyKeyList( appName,
kCFPreferencesCurrentUser,
kCFPreferencesCurrentHost );
if( keys == NULL )
{
NSLog( @"keys is NULL!!" );
return;
}

The plist ~/Library/Preferences/com.apple.myPref.plist looks like this
(minus the extra xml stuff):
<dict>
<key>WWWHomePage</key>
<string>http://www.blah.com/</string>
</dict>


I am ultimately trying to set the WWWHomePage preference found in
com.apple.internetconfig from an application other than Safari, but I'm
attempting to learn the basics of CFPreferences first before I mess with a
much larger target.

I'm out of guesses as to what's wrong. Any help is appreciated.

Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Colored pill-shape background in NSTableView row
  • Next by Date: Re: key value observing stops
  • Previous by thread: Colored pill-shape background in NSTableView row
  • Next by thread: NSHFSTypeCodeFromFileType() == 0?
  • Index(es):
    • Date
    • Thread