Mac Forums

Mac Forums (
-   OS X - Development and Darwin (
-   -   Code conversion question (

vishal.chauhan 06-08-2009 06:07 AM

Code conversion question
Dear All,

I want to convert from CFTypeRef to CFStringRef, I am using the following code -


CFStringRef myString = CFCopyDescription (value);
But is gives the string with expression but I want only its value.
If anybody knows how to do that then plz help me out.


xstep 06-08-2009 01:18 PM

You are out of my common knowledge...

Assuming the value is an NSString then have you tried this;
CFStringRef myString = (CFStringRef) value;
I type cast to avoid a compiler warning; initialization from incompatible pointer type. I find that curious because as I understand the documentation, the types are suppose to be equivalent.

You may want to review the CFType Reference and CFString Reference documentation at Apple.

dtravis7 06-11-2009 06:23 PM

I closed this thread for now as spammers are constantly using it for their spam. If the OP needs any more help on this topic, let us know.

All times are GMT -4. The time now is 08:17 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.