Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Code conversion question (http://www.mac-forums.com/forums/os-x-development-darwin/154978-code-conversion-question.html)

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 -

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.


Thanks.
Vishal

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 04:27 PM.

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