When converting NSString to constants, I usually use
[@"..." UTF8String];
I was just looking over apple docs on address book programming and i see they use the macro
CFSTR("...");
Out of curiousity, I’m just wondering is there any different between the two?
CFSTR("...")is essentially the Core Foundation equivalent of@"...". In fact, you can do the following:And you’ll get the same result as you would with your first line of code.
In theory,
CFSTR()creates a constantCFString, while@""creates a constantNSString. In practice, the two types are interchangeable.Does that help?