I'm working on a program that would monopolize the main thread for its own purposes. Conditionally, this program may need to spawn Cocoa windows. However, because the main thread would not be running an event loop (or at least not a NSRunLoop
), I was wondering if I would be able to run the UI with a NSRunLoop
from a secondary thread.
I know the equivalent is possible on Windows, but it's not clear from the documentation if this would work on Mac OS, nor how to do it at all if it's possible.
For one thing, NSApplicationMain
must be called by the main thread.