implementAsBlocking static method

NSCacheDelegate implementAsBlocking({
  1. void cache_willEvictObject_(
    1. NSCache,
    2. ObjCObjectBase
    )?,
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSCacheDelegate protocol. To implement multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All methods that can be implemented as blocking listeners will be.

If $keepIsolateAlive is true, this protocol will keep this isolate alive until it is garbage collected by both Dart and ObjC.

Implementation

static NSCacheDelegate implementAsBlocking({
  void Function(NSCache, objc.ObjCObjectBase)? cache_willEvictObject_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSCacheDelegate');
  NSCacheDelegate.cache_willEvictObject_.implementAsBlocking(
    builder,
    cache_willEvictObject_,
  );
  builder.addProtocol($protocol);
  return NSCacheDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}