Re: CFPreferences
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