[Solved] iOS message pump not running


#1

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


#2

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


#3

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

everything works as expected. Caveats?


#4

has anyone confirmed this?


#5

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).


#6

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?


#7

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.


#8

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