Document the fact that we only need an NSRunLoop in the example because there isn't one already.

This commit is contained in:
Nolan Darilek 2020-09-23 10:33:30 -05:00
parent 6788277a4d
commit c5524113ff
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,8 @@ fn main() -> Result<(), Error> {
}
tts.speak("Goodbye.", false)?;
let mut _input = String::new();
// The below is only needed to make the example run on MacOS because there is no NSRunLoop in this context.
// It shouldn't be needed in an app or game that almost certainly has one already.
#[cfg(target_os = "macos")]
{
let run_loop: id = unsafe { NSRunLoop::currentRunLoop() };