MyApp is calling TIS/TSM in non-main thread environment

Since Xcode 9.4, whenever I run my main app in the debugger, I get this warning in the console:


MyApp[nnnn:nnnnnn] pid(nnn)/euid(nnn) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!


Can someone enlighten what TIS/TSM is, so that I can fix this warning?


Thanks,


J.

Accepted Reply

I expect that message is coming from the Main Thread Checker: https://developer.apple.com/documentation/code_diagnostics/main_thread_checker


TIS = Text Input Sources

TSM = Text Services Manager


You're doing something like trying to translate key events to characters on a background thread.


There's a setting in the Scheme editor to make your app pause when it hits such a problem, so you can see the stack trace.

Replies

I expect that message is coming from the Main Thread Checker: https://developer.apple.com/documentation/code_diagnostics/main_thread_checker


TIS = Text Input Sources

TSM = Text Services Manager


You're doing something like trying to translate key events to characters on a background thread.


There's a setting in the Scheme editor to make your app pause when it hits such a problem, so you can see the stack trace.

Just to thank you, Ken. This really helped me. I was indeed using a Text Input Source in a background thread to translate key events to characters and vice versa. Apparently, that is a no-no, although it didn't crash my app.

For what it's worth, I don't think this behavior is happening because of the Main Thread Checker. At least in Mojave Beta, I was seeing the message in the console even without the main thread checker enabled.

Just for closure here, jalkut wrote a blog post about how they debugged this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"