Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The scheduledTimer function relies on the run loop of the application to function correctly. If a timer is set up outside a block, it is added to the run loop and scheduled to execute at the specified interval. However, if a timer is set up inside a block, it may not be added to the run loop immediately and may not execute as expected. This is because the block may be executed on a different thread or at a later time, interrupting the normal flow of the run loop. To ensure a timer functions correctly, it should be set up outside any blocks and added to the run loop immediately.