Contents

init(CString:)

Initializes the receiver, a newly allocated NSString object, by converting the data in a given C-string from the default C-string encoding into the Unicode character encoding.

Declaration

convenience init?(CString bytes: UnsafePointer<CChar>)

Discussion

cString must be a zero-terminated C string in the default C string encoding, and may not be NULL. Returns an initialized object, which might be different from the original receiver.

To create an immutable string from an immutable C string buffer, do not attempt to use this method. Instead, use init(CStringNoCopy:length:freeWhenDone:).

See Also

Deprecated