Creates an immutable string from a constant compile-time string.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
A constant C string (that is, text enclosed in double-quotation marks) from which the string is to be created.
An immutable string, or
NULL if there was a problem creating the object. The returned object is a constant. You may retain and release it, similar to other immutable CFString objects, but are not required to do so—it will remain valid until the program terminates.
CFSTR macro is a convenient way to create CFString representations of constant compile-time strings.
A value returned by
CFSTR has the following semantics:
Values returned from
CFSTRare not released by CFString—they are guaranteed to be valid until the program terminates.
You can retain and release values returned from
CFSTRin a balanced fashion, like any other CFString, but you are not required to do so.