const char* cString = "Hello, world!"; CFStringRef cfString = createCFString(cString);
CFStringRef cfString1 = CFSTR("Hello"); CFStringRef cfString2 = createCFString(cfString1);In both examples, the createCFString function takes a C string or a Core Foundation string as input and returns a new Core Foundation string object. The package library that contains the createCFString function is the Core Foundation framework in Apple's Cocoa library.