Function schedule

  • Schedule the JavaScript function work on the GCD queue specified by queue. An NSAutoreleasePool is created just before calling work, and cleaned up on return.

    E.g. on macOS:

        const { NSSound } = ObjC.classes;
    ObjC.schedule(ObjC.mainQueue, () => {
    const sound = NSSound.alloc().initWithContentsOfFile_byReference_("/Users/oleavr/.Trash/test.mp3", true).autorelease();
    sound.play();
    });

    Parameters

    • queue: NativePointerValue

      GCD queue to schedule work on.

    • work: (() => void)

      Function to call on the specified queue.

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc