fromFunctionPointer static method
ObjCBlock<NSRange Function(Pointer<Void> , Long)>
fromFunctionPointer(
- Pointer<
NativeFunction< ptrNSRange Function(Pointer< >Void> , Long)>
Creates a block from a C function pointer.
This block must be invoked by native code running on the same thread as the isolate that registered it. Invoking the block on the wrong thread will result in a crash.
Implementation
static objc.ObjCBlock<objc.NSRange Function(ffi.Pointer<ffi.Void>, ffi.Long)>
fromFunctionPointer(
ffi.Pointer<
ffi.NativeFunction<
NSRange Function(ffi.Pointer<ffi.Void> arg0, NSInteger arg1)
>
>
ptr,
) => objc.ObjCBlock<objc.NSRange Function(ffi.Pointer<ffi.Void>, ffi.Long)>(
objc.newPointerBlock(
_ObjCBlock_NSRange_ffiVoid_NSInteger_fnPtrCallable,
ptr.cast(),
),
retain: false,
release: true,
);