Instance Property

UTF8String

A null-terminated UTF8 representation of the string.

Declaration

@property(readonly) const char *UTF8String;

Discussion

This C string is a pointer to a structure inside the string object, which may have a lifetime shorter than the string object and will certainly not have a longer lifetime. Therefore, you should copy the C string if it needs to be stored outside of the memory context in which you use this property.

See Also

Getting C Strings

cStringUsingEncoding:

Returns a representation of the string as a C string using a given encoding.

getCString:maxLength:encoding:

Converts the string to a given encoding and stores it in a buffer.