Display problem occurs when writing code with Macbook-Apple system Text input context does not respond to _valueForTIProperty:

Macbook / Apple system has display problems writing code

When using a Mac system, when writing code, if there is a GUI display interface, then you click on this interface. At this time, an error will be reported.
My source code is to read pictures and display pictures.

import cv2 as cv
pic = cv.imread("test.jpeg")
dst = cv.resize(pic, (512, 512))
cv.imshow("This is the test pic!", dst)
cv.waitKey(5000)

The error message is as follows:

2021-01-10 19:54:02.332 python[8857:163844] _TIPropertyValueIsValid called with 4 on nil context!
2021-01-10 19:54:02.332 python[8857:163844] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2021-01-10 19:54:02.332 python[8857:163844] Text input context does not respond to _valueForTIProperty:
2021-01-10 19:54:02.334 python[8857:163844] _TIPropertyValueIsValid called with 4 on nil context!
2021-01-10 19:54:02.334 python[8857:163844] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2021-01-10 19:54:02.334 python[8857:163844] Text input context does not respond to _valueForTIProperty:
2021-01-10 19:54:02.344 python[8857:163844] _TIPropertyValueIsValid called with 4 on nil context!
2021-01-10 19:54:02.344 python[8857:163844] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2021-01-10 19:54:02.344 python[8857:163844] Text input context does not respond to _valueForTIProperty:
2021-01-10 19:54:04.070 python[8857:163844] _TIPropertyValueIsValid called with 4 on nil context!
2021-01-10 19:54:04.070 python[8857:163844] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2021-01-10 19:54:04.070 python[8857:163844] Text input context does not respond to _valueForTIProperty:
2021-01-10 19:54:04.087 python[8857:163844] _TIPropertyValueIsValid called with 4 on nil context!
2021-01-10 19:54:04.087 python[8857:163844] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
2021-01-10 19:54:04.087 python[8857:163844] Text input context does not respond to _valueForTIProperty:

Insert picture description here

The main message of the error is:
2021-01-10 19:54:04.087 python[8857:163844] Text input context does not respond to _valueForTIProperty:

This indicates that your current input method is Chinese, and then click this GUI, and this error appears. You need to switch your input method to English input to solve this problem.

Here is the answer in English:

This problem is not related to the Swift code at all. I code the Swift application with Japanese input source on macOS because my keyboard layout is Japanese, hence the error messages are shown on Terminal/console when the application window get/lost focus.
Changing the Input Sources to English - ABC solves the problem. You can change the Input Sources from macOS System Preferences - Keyboard. Add or change the Input Source to English - ABC from Input Sources tab.

Guess you like

Origin blog.csdn.net/qq_32998593/article/details/112440843