[Solved] iOS message pump not running

Hi all,

I’m setting up an app for iPhone, but I have a problem with messages not being propagated through the message pump. In juce_osx_MessageQueue.h, I see the MessageQueue getting instiantiated, messages getting posted to MessageQueue::post, but runLoopCallback never gets called.

Ideas ?

We’re sitting on JUCE commit 27047a75f719acb243bde1bf9b741dd03d7b6466 (2015-12-17)

Regards
/Robert

I checked, there are no differences in that code wrt current head.

If I change:
runLoop = CFRunLoopGetCurrent();
to:
runLoop = CFRunLoopGetMain();

everything works as expected. Caveats?

1 Like

has anyone confirmed this?

Mind you, the project is a native Swift/Objective-C based app, which links statically to a C++ library which uses JUCE. That might be important (or not).

It seems that your app is not setting up the MessageQueue on the main thread/run-loop. Could it be that your native app sets the run loop to something else before it initialises JUCE?

1 Like

Thanks Fabian, could very well be, since the first time a message is posted is in a worker thread. I’ll try post just a “dummy” message to guarantee it starts on the main thread, see if that helps.

Indeed, by forcing the setup of MessageQueue on the main thread, it works just fine. Sorry for the noise!

1 Like