Creates an immutable string from a C string.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The allocator to use to allocate memory for the new string. Pass
kto use the current default allocator.
NULL-terminated C string to be used to create the CFString object. The string must use an 8-bit encoding.
The encoding of the characters in the C string. The encoding must specify an 8-bit encoding.
An immutable string containing
c (after stripping off the
NULL terminating character), or
NULL if there was a problem creating the object. Ownership follows the The Create Rule.
A C string is a string of 8-bit characters terminated with an 8-bit
NULL. Unichar and Unichar32 are not considered C strings.