• 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
Re: CFPreferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFPreferences


  • Subject: Re: CFPreferences
  • From: Tom Harrington <email@hidden>
  • Date: Fri, 27 Jan 2006 10:39:25 -0700

On 1/27/06, Alan Smith <email@hidden> wrote:
> I need to get to the desktop preference file and read the "ImageFilePath".
> But I need it as a string to be able to display it in a text field. I've
> tried CFPreferencesCopyAppValue but can't find a way to convert the returned
> value to a NSString, at least not a way that works.

CFPreferencesCopyAppValue returns a CFPropertyListRef-- meaning that
it's the CF version of one of the property list classes.  These are
all toll-free bridged to Cocoa classes, so all you should need to do
to get an NSString is typecast it.  If the return value in your case
is a CFStringRef, you can just cast to NSString *.  If it's some other
plist type, cast to the appropriate class.  If you're not sure what
type you have, you can use CFGetTypeID (or just debug the app and use
"po").

--
Tom Harrington
email@hidden
AIM: atomicbird1
 _______________________________________________
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

  • Follow-Ups:
    • Re: CFPreferences
      • From: Uli Kusterer <email@hidden>
References: 
 >CFPreferences (From: Alan Smith <email@hidden>)

  • Prev by Date: Newb Question: escaping quotes in a string
  • Next by Date: Re: NSTextStorage subclass
  • Previous by thread: CFPreferences
  • Next by thread: Re: CFPreferences
  • Index(es):
    • Date
    • Thread