addObserver method

void addObserver(
  1. NSObject observer, {
  2. required NSString forKeyPath,
  3. required NSKeyValueObservingOptions options,
  4. required Pointer<Void> context,
})

addObserver:forKeyPath:options:context:

Implementation

void addObserver(
  objc.NSObject observer, {
  required objc.NSString forKeyPath,
  required objc.NSKeyValueObservingOptions options,
  required ffi.Pointer<ffi.Void> context,
}) {
  objc.checkOsVersionInternal(
    'NSObject.addObserver:forKeyPath:options:context:',
    iOS: (false, (2, 0, 0)),
    macOS: (false, (10, 0, 0)),
  );
  _objc_msgSend_akk2cd(
    this.ref.pointer,
    _sel_addObserver_forKeyPath_options_context_,
    observer.ref.pointer,
    forKeyPath.ref.pointer,
    options.value,
    context,
  );
}