initWithBytesNoCopy method

NSString? initWithBytesNoCopy(
  1. Pointer<Void> bytes, {
  2. required DartNSUInteger length,
  3. required DartNSUInteger encoding,
  4. ObjCBlock<Void Function(Pointer<Void>, UnsignedLong)>? deallocator,
})

initWithBytesNoCopy:length:encoding:deallocator:

Implementation

NSString? initWithBytesNoCopy(
  ffi.Pointer<ffi.Void> bytes, {
  required DartNSUInteger length,
  required DartNSUInteger encoding,
  objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.UnsignedLong)>?
  deallocator,
}) {
  final _$$ref = object$.ref;
  final _$$ref$1 = deallocator?.ref;
  final $ret = _objc_msgSend_1lbgrac(
    _$$ref.retainAndReturnPointer(),
    _sel_initWithBytesNoCopy_length_encoding_deallocator_,
    bytes,
    length,
    encoding,
    _$$ref$1?.pointer ?? ffi.nullptr,
  );
  return $ret.address == 0
      ? null
      : NSString.fromPointer($ret, retain: false, release: true);
}