Converts the receiver’s content to the default C-string encoding and stores them in a given buffer.
- iOS 2.0–2.0Deprecated
- macOS 10.0–10.4Deprecated
- tvOS 2.0–2.0Deprecated
- watchOS 2.0–2.0Deprecated
buffer must be large enough to contain
max bytes plus a terminating zero character (which this method adds). Copies and converts as many characters as possible from
a and stores the range of those not converted in the range given by
leftover (if it’s non-
nil). Raises an
NSRange if any part of
a lies beyond the end of the string.
NSCharacter if the receiver can’t be represented in the default C-string encoding without loss of information. Use
can if necessary to check whether a string can be losslessly converted to the default C-string encoding. If it can’t, use
data(using: to get a C-string representation with some loss of information.