Creates a CFRunLoopObserver object with a block-based handler.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The allocator to use to allocate memory for the new object. Pass
kto use the current default allocator.
A flag identifying whether the observer is called only once or every time through the run loop. If
false, the observer is invalidated after it is called once, even if the observer was scheduled to be called at multiple stages within the run loop.
A priority index indicating the order in which run loop observers are processed. When multiple run loop observers are scheduled in the same activity stage in a given run loop mode, the observers are processed in increasing order of this parameter. Pass 0 unless there is a reason to do otherwise.
The block invoked when the observer runs. The block takes two arguments:
The run loop observer that is firing.
The current activity stage of the run loop.
The new CFRunLoopObserver object. Ownership follows the Create Rule described in Ownership Policy.
The run loop observer is not automatically added to a run loop. To add the observer to a run loop, use
CFRun. An observer can be registered to only one run loop, although it can be added to multiple run loop modes within that run loop.