init(charactersNoCopy:length:freeWhenDone:)
Returns an initialized NSString object that contains a given number of characters from a given C array of UTF-16 code units.
Declaration
convenience init(charactersNoCopy characters: UnsafeMutablePointer<unichar>, length: Int, freeWhenDone freeBuffer: Bool)Parameters
Return Value
An initialized NSString object that contains length characters from characters. The returned object may be different from the original receiver.
Discussion
If an error occurs during the creation of the string, then bytes is not freed even if flag is true. In this case, the caller is responsible for freeing the buffer. This allows the caller to continue trying to create a string with the buffer, without having the buffer deallocated.