Code conversion question

Status
Not open for further replies.
Joined
Dec 13, 2006
Messages
13
Reaction score
0
Points
1
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
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
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


Retired Staff
Joined
Jan 4, 2005
Messages
30,133
Reaction score
703
Points
113
Location
Modesto, Ca.
Your Mac's Specs
MacMini M-1 MacOS Monterey, iMac 2010 27"Quad I7 , MBPLate2011, iPad Pro10.5", iPhoneSE
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.
 
Status
Not open for further replies.

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top