I am making an app for OS X using Cocoa for the graphical interface. But my main algorithm was made in C++. The interface just shows some values of the algorithm in NSTextFields and NSLevelIndicator.
The screen needs to be refresh with the data from the algorithm in real time.
What i did is a NSThread that reads the data from the algorithm and put on screen. But I don’t think that it’s the proper way.
What are your suggestions?
Generally, you should only update the GUI from the main thread. You can submit some work to the main thread with code like this: