I need to be able to halt a method while it waits for user input.
I tried using a while (true) loop to check to see if a boolean was set indicating that the operation had completed, but as I predicted, it made the application non-responsive.
How do you halt and resume a method after a variable has been set, without calling the method again, and without making the entire application non-responsive.
Here’s basically what the program does
openFile method called
openFile method determines whether file has a password
if it does, display an alert to the user requesting the password
Here’s the problem, halting the method until the password has been entered.
Any help appreciated.
You can’t. You need to split it up into two methods, one that does the initial check and then prompts for the password, then the second that uses the password to get the file.