Creates a new CFRunLoopTimer object with a function callback.
- iOS 2.0+
- macOS 10.0+
- 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.
The time at which the timer should first fire. The fine precision (sub-millisecond at most) of the fire date may be adjusted slightly by the timer if there are implementation reasons to do so.
The firing interval of the timer. If
0or negative, the timer fires once and then is automatically invalidated. The fine precision (sub-millisecond at most) of the interval may be adjusted slightly by the timer if implementation reasons to do so exist.
Currently ignored. Pass
0for future compatibility.
A priority index indicating the order in which run loop timers are processed. Run loop timers currently ignore this parameter. Pass
The callback function that is called when the timer fires.
A structure holding contextual information for the run loop timer. The function copies the information out of the structure, so the memory pointed to by
contextdoes not need to persist beyond the function call. Can be
NULLif the callback function does not need the context’s
infopointer to keep track of state.
The new CFRunLoopTimer object. Ownership follows the The Create Rule.
A timer needs to be added to a run loop mode before it will fire. To add the timer to a run loop, use
CFRun. A timer can be registered to only one run loop at a time, although it can be in multiple modes within that run loop.