SleepCurrentThread

My application is simple - I’d like to emulate the Desktop synchronous msgBox with the asynch iosMessageBox. The challenge is to make it synchronous so that I can call result = msgbox text. I can use a timer and a While-Wend loop to check for a state change, but this is going to hog the processor. I’d like a non processor hogging version.

I thought app.sleepCurrentThread would do it, but of course its not available in iOS.

The alternative is to re-write all the code to accept an asynchronous response - which is a horrible prospect.

Thoughts?

the reality is that iOS IS ASYNC all over the place

suppose you have a method like

  do some stuff

  msgbox ....

  do some more stuff

in iOS take the “do some more stuff” and put it in the event handler for the msgbox button action

now you DO lose your locals from the first portion

you could stuff them in properties on the view & preserve them across the two methods

Like Norman said, asynchronous features will always put you under reconstruction stress. Have you considered building a custom MessageBox iOSView instead and presenting it modally?

Thanks both of you. With around 60 msgbox calls to update it is tempting to do as you suggest Ulrich.