Invokes the passed-in block on the main thread.
- macOS 10.7+
The block to be invoked.
If the main thread is blocked by an invocation of
perform, this method interrupts that blocking activity, performs the specified
block, and then resumes the blocking activity after
block returns. Invocations of this method always return before the passed-in block is invoked.
You can invoke this method when work is being done on a non-main thread and part of the work must be continued on the main thread. For example,
save uses this method when it has just completed the actual writing of the file during asynchronous saving and, to finish the saving operation, must invoke
update and other methods on the main thread.
This method can be invoked on any thread.